Thread View: linux.kernel.netdev
4 messages
4 total messages
Started by Meghana Malladi
Tue, 10 Nov 2026 12:26
[PATCH net v3 0/3] Fix switch mode for offload and non-offload cases
Author: Meghana Malladi
Date: Tue, 10 Nov 2026 12:26
Date: Tue, 10 Nov 2026 12:26
25 lines
21709 bytes
21709 bytes
Non-offloaded switch mode is failing to forward packets. This patch series introduces fixes to ensure smooth operation of switch mode in both offload and non-offload cases. patch(1/3): Fix TX timestamp cleanup crash (ERR_PTR slot handling) patch(2/3): Fix phylib stop/start in emac_restart (R30 command race) patch(3/3): Fix bridge port_vlan and flooding state (multicast/unicast forwarding) v2: https://lore.kernel.org/all/20261027131732.3411403-1-m-malladi@ti.com/ Meghana Malladi (3): net: ti: icssg-prueth: Fix TX timestamp cleanup crash net: ti: icssg-prueth: Fix phylib stop/start in emac_restart net: ti: icssg-prueth: Fix bridge port_vlan and flooding state drivers/net/ethernet/ti/icssg/icssg_common.c | 9 ++-- drivers/net/ethernet/ti/icssg/icssg_prueth.c | 46 ++++++++++++++++++-- drivers/net/ethernet/ti/icssg/icssg_prueth.h | 4 ++ 3 files changed, 52 insertions(+), 7 deletions(-) base-commit: af6f95c3300e3d234c813b80f831dd7b80b3eaf2 -- 2.43.0
[PATCH net v3 1/3] net: ti: icssg-prueth: Fix TX timestamp cleanup crash
Author: Meghana Malladi
Date: Tue, 10 Nov 2026 12:26
Date: Tue, 10 Nov 2026 12:26
40 lines
22368 bytes
22368 bytes
prueth_cleanup_tx_ts() incorrectly frees ERR_PTR(-EBUSY) slots. The TX
path reserves slots with ERR_PTR(-EBUSY) before storing the real skb
pointer. Use IS_ERR_OR_NULL() to skip these reserved slots during
cleanup, preventing NULL pointer dereference and freeing errors.
Fixes: e2dc7bfd677fc ("net: ti: icssg-prueth: Move common functions into a separate file")
Signed-off-by: Meghana Malladi <m-malladi@ti.com>
---
Changes from v2(v3-v2):
- Added this commit in the series which fixes the pre-existing issues
flagged by sashiko
drivers/net/ethernet/ti/icssg/icssg_common.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c
index 4a7d1a6f470b..8cb2ad2ebece 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_common.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_common.c
@@ -1426,10 +1426,13 @@ void prueth_cleanup_tx_ts(struct prueth_emac *emac)
int i;
for (i = 0; i < PRUETH_MAX_TX_TS_REQUESTS; i++) {
- if (emac->tx_ts_skb[i]) {
+ /* Slot may hold ERR_PTR(-EBUSY) if the TX path reserved it
+ * but has not yet stored the real skb pointer. Skip the free
+ * but still clear the slot so it can be reused.
+ */
+ if (!IS_ERR_OR_NULL(emac->tx_ts_skb[i]))
dev_kfree_skb_any(emac->tx_ts_skb[i]);
- emac->tx_ts_skb[i] = NULL;
- }
+ emac->tx_ts_skb[i] = NULL;
}
}
EXPORT_SYMBOL_GPL(prueth_cleanup_tx_ts);
--
2.43.0
[PATCH net v3 2/3] net: ti: icssg-prueth: Fix phylib stop/start in emac_restart
Author: Meghana Malladi
Date: Tue, 10 Nov 2026 12:27
Date: Tue, 10 Nov 2026 12:27
76 lines
23462 bytes
23462 bytes
Call phy_stop()/phy_start() around the firmware halt in
prueth_emac_restart() to prevent phylib from issuing R30 commands
to the stopped PRU. Without this, emac_adjust_link() can race with
firmware reload and write invalid state.
Fixes: 9facce84f4062 ("net: ti: icssg-prueth: Fix firmware load sequence.")
Signed-off-by: Meghana Malladi <m-malladi@ti.com>
---
Changes from v2(v3-v2):
- Added this commit in the series which fixes the pre-existing issues
flagged by sashiko
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 21 +++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index 591be5c8056b..ef5dce595f68 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -1837,6 +1837,14 @@ static int prueth_emac_restart(struct prueth *prueth)
struct prueth_emac *emac1 = prueth->emac[PRUETH_MAC1];
int ret;
+ /* Halt phylib to stop emac_adjust_link() from issuing R30 commands
+ * to the PRU while the firmware is stopped.
+ */
+ if (emac0->ndev->phydev)
+ phy_stop(emac0->ndev->phydev);
+ if (emac1->ndev->phydev)
+ phy_stop(emac1->ndev->phydev);
+
/* Detach the net_device for both PRUeth ports*/
if (netif_running(emac0->ndev))
netif_device_detach(emac0->ndev);
@@ -1847,20 +1855,20 @@ static int prueth_emac_restart(struct prueth *prueth)
ret = icssg_set_port_state(emac0, ICSSG_EMAC_PORT_DISABLE);
ret |= icssg_set_port_state(emac1, ICSSG_EMAC_PORT_DISABLE);
if (ret)
- return ret;
+ goto restart_phy;
/* Stop both pru cores for both PRUeth ports*/
ret = prueth_emac_common_stop(prueth);
if (ret) {
dev_err(prueth->dev, "Failed to stop the firmwares");
- return ret;
+ goto restart_phy;
}
/* Start both pru cores for both PRUeth ports */
ret = prueth_emac_common_start(prueth);
if (ret) {
dev_err(prueth->dev, "Failed to start the firmwares");
- return ret;
+ goto restart_phy;
}
/* Enable forwarding for both PRUeth ports */
@@ -1871,6 +1879,13 @@ static int prueth_emac_restart(struct prueth *prueth)
netif_device_attach(emac0->ndev);
netif_device_attach(emac1->ndev);
+restart_phy:
+ /* Resume phylib now that the firmware is running again. */
+ if (emac0->ndev->phydev)
+ phy_start(emac0->ndev->phydev);
+ if (emac1->ndev->phydev)
+ phy_start(emac1->ndev->phydev);
+
return ret;
}
--
2.43.0
Re: [PATCH net v3 1/3] net: ti: icssg-prueth: Fix TX timestamp cleanup crash
Author: Vadim Fedorenko
Date: Sun, 29 Nov 2026 16:14
Date: Sun, 29 Nov 2026 16:14
41 lines
10006 bytes
10006 bytes
On 10/11/2026 12:26, Meghana Malladi wrote:
> prueth_cleanup_tx_ts() incorrectly frees ERR_PTR(-EBUSY) slots. The TX
> path reserves slots with ERR_PTR(-EBUSY) before storing the real skb
> pointer. Use IS_ERR_OR_NULL() to skip these reserved slots during
> cleanup, preventing NULL pointer dereference and freeing errors.
>
> Fixes: e2dc7bfd677fc ("net: ti: icssg-prueth: Move common functions into a separate file")
> Signed-off-by: Meghana Malladi <m-malladi@ti.com>
> ---
>
> Changes from v2(v3-v2):
> - Added this commit in the series which fixes the pre-existing issues
> flagged by sashiko
>
> drivers/net/ethernet/ti/icssg/icssg_common.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c
> index 4a7d1a6f470b..8cb2ad2ebece 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_common.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c
> @@ -1426,10 +1426,13 @@ void prueth_cleanup_tx_ts(struct prueth_emac *emac)
> int i;
>
> for (i = 0; i < PRUETH_MAX_TX_TS_REQUESTS; i++) {
> - if (emac->tx_ts_skb[i]) {
> + /* Slot may hold ERR_PTR(-EBUSY) if the TX path reserved it
> + * but has not yet stored the real skb pointer. Skip the free
> + * but still clear the slot so it can be reused.
> + */
> + if (!IS_ERR_OR_NULL(emac->tx_ts_skb[i]))
> dev_kfree_skb_any(emac->tx_ts_skb[i]);
> - emac->tx_ts_skb[i] = NULL;
> - }
> + emac->tx_ts_skb[i] = NULL;
> }
> }
> EXPORT_SYMBOL_GPL(prueth_cleanup_tx_ts);
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads