* [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
@ 2026-02-05 6:25 Kevin Hao
2026-02-05 8:34 ` MD Danish Anwar
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Kevin Hao @ 2026-02-05 6:25 UTC (permalink / raw)
To: netdev
Cc: Kevin Hao, MD Danish Anwar, Roger Quadros, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Meghana Malladi, Jacob Keller, Vadim Fedorenko, Himanshu Mittal,
Simon Horman, Byungchul Park, Markus Elfring, linux-arm-kernel
Currently, both the icssg-prueth and icssg-prueth-sr1 drivers create
a dedicated 'emac->cmd_wq' workqueue.
In the icssg-prueth-sr1 driver, this workqueue is not utilized at all.
In the icssg-prueth driver, the workqueue is only used to execute the
actual processing of ndo_set_rx_mode. However, creating a dedicated
workqueue for such a simple use case is unnecessary. To simplify the
code, switch to using the system default workqueue instead.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
While addressing an issue in the cpsw driver, I based my fix [1] on the
implementation of the emac_ndo_set_rx_mode() function in icssg. During review,
Jakub pointed out that the dedicated workqueue for the ndo_set_rx_mode
callback might be unnecessary [2]. I subsequently used the system workqueue for
this purpose in the cpsw driver, and it performed as expected. Therefore,
I believe the same approach can be applied to the icssg driver. This
patch aim to remove this dedicated workqueue for icssg drivers.
Please note: I do not have access to a board that supports the CSSG PRU
Ethernet controller, so this change has only been build-tested.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=c0b5dc73a38f954e780f93a549b8fe225235c07a
[2] https://lore.kernel.org/all/20260127190836.6a420768@kernel.org/
---
Cc: MD Danish Anwar <danishanwar@ti.com>
Cc: Roger Quadros <rogerq@kernel.org>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Meghana Malladi <m-malladi@ti.com>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: Himanshu Mittal <h-mittal1@ti.com>
Cc: Simon Horman <horms@kernel.org>
Cc: Byungchul Park <byungchul@sk.com>
Cc: Markus Elfring <elfring@users.sourceforge.net>
Cc: linux-arm-kernel@lists.infradead.org
---
Changes in v2:
- Given the issue identified by the AI [3], squash these two patches into
one as suggested by Jakub.
- Include the cpsw fix link and the link to Jakub's email in the cover letter,
as requested by Meghana.
- Link to v1: https://lore.kernel.org/r/20260204-icssg-prueth-workqueue-v1-0-9a892f4b293d@gmail.com
[3] https://netdev-ai.bots.linux.dev/ai-review.html?id=02da18ab-455d-4d98-88bb-d8a975623c3f
---
drivers/net/ethernet/ti/icssg/icssg_common.c | 1 -
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 13 ++++---------
drivers/net/ethernet/ti/icssg/icssg_prueth.h | 1 -
drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c | 9 +--------
4 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c
index 090aa74d3ce7257ae52158b2ff9a2a1239bfcfc8..0cf9dfe0fa362b4ff986b6815952f95b79cb476d 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_common.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_common.c
@@ -1720,7 +1720,6 @@ void prueth_netdev_exit(struct prueth *prueth,
netif_napi_del(&emac->napi_rx);
pruss_release_mem_region(prueth->pruss, &emac->dram);
- destroy_workqueue(emac->cmd_wq);
free_netdev(emac->ndev);
prueth->emac[mac] = NULL;
}
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index f65041662173c1968f7e70dc4a3d897523f24095..0939994c932f5322eebbaa1b2fe43e20d3dca5ae 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -1099,7 +1099,7 @@ static void emac_ndo_set_rx_mode(struct net_device *ndev)
{
struct prueth_emac *emac = netdev_priv(ndev);
- queue_work(emac->cmd_wq, &emac->rx_mode_work);
+ schedule_work(&emac->rx_mode_work);
}
static netdev_features_t emac_ndo_fix_features(struct net_device *ndev,
@@ -1451,11 +1451,6 @@ static int prueth_netdev_init(struct prueth *prueth,
emac->port_id = port;
emac->xdp_prog = NULL;
emac->ndev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
- emac->cmd_wq = create_singlethread_workqueue("icssg_cmd_wq");
- if (!emac->cmd_wq) {
- ret = -ENOMEM;
- goto free_ndev;
- }
INIT_WORK(&emac->rx_mode_work, emac_ndo_set_rx_mode_work);
INIT_DELAYED_WORK(&emac->stats_work, icssg_stats_work_handler);
@@ -1467,7 +1462,7 @@ static int prueth_netdev_init(struct prueth *prueth,
if (ret) {
dev_err(prueth->dev, "unable to get DRAM: %d\n", ret);
ret = -ENOMEM;
- goto free_wq;
+ goto free_ndev;
}
emac->tx_ch_num = 1;
@@ -1566,8 +1561,6 @@ static int prueth_netdev_init(struct prueth *prueth,
free:
pruss_release_mem_region(prueth->pruss, &emac->dram);
-free_wq:
- destroy_workqueue(emac->cmd_wq);
free_ndev:
emac->ndev = NULL;
prueth->emac[mac] = NULL;
@@ -2236,6 +2229,7 @@ static int prueth_probe(struct platform_device *pdev)
prueth->emac[i]->ndev->phydev = NULL;
}
unregister_netdev(prueth->registered_netdevs[i]);
+ disable_work_sync(&prueth->emac[i]->rx_mode_work);
}
netdev_exit:
@@ -2295,6 +2289,7 @@ static void prueth_remove(struct platform_device *pdev)
phy_disconnect(prueth->emac[i]->ndev->phydev);
prueth->emac[i]->ndev->phydev = NULL;
unregister_netdev(prueth->registered_netdevs[i]);
+ disable_work_sync(&prueth->emac[i]->rx_mode_work);
}
for (i = 0; i < PRUETH_NUM_MACS; i++) {
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.h b/drivers/net/ethernet/ti/icssg/icssg_prueth.h
index 10eadd35665045a98a0c0a639606b7c2691195de..3d94fa5a7ac10992d35fdb63458f8cb6eb3a5a22 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.h
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.h
@@ -236,7 +236,6 @@ struct prueth_emac {
/* Mutex to serialize access to firmware command interface */
struct mutex cmd_lock;
struct work_struct rx_mode_work;
- struct workqueue_struct *cmd_wq;
struct pruss_mem_region dram;
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
index 7bb4f0d850cc72d997e5ead38cf56f1dbc2355a1..b8115ca47082f9676067bb65c6eb3a441290fd7c 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
@@ -783,11 +783,6 @@ static int prueth_netdev_init(struct prueth *prueth,
emac->prueth = prueth;
emac->ndev = ndev;
emac->port_id = port;
- emac->cmd_wq = create_singlethread_workqueue("icssg_cmd_wq");
- if (!emac->cmd_wq) {
- ret = -ENOMEM;
- goto free_ndev;
- }
INIT_DELAYED_WORK(&emac->stats_work, icssg_stats_work_handler);
@@ -798,7 +793,7 @@ static int prueth_netdev_init(struct prueth *prueth,
if (ret) {
dev_err(prueth->dev, "unable to get DRAM: %d\n", ret);
ret = -ENOMEM;
- goto free_wq;
+ goto free_ndev;
}
/* SR1.0 uses a dedicated high priority channel
@@ -883,8 +878,6 @@ static int prueth_netdev_init(struct prueth *prueth,
free:
pruss_release_mem_region(prueth->pruss, &emac->dram);
-free_wq:
- destroy_workqueue(emac->cmd_wq);
free_ndev:
emac->ndev = NULL;
prueth->emac[mac] = NULL;
---
base-commit: 0f8a890c4524d6e4013ff225e70de2aed7e6d726
change-id: 20260203-icssg-prueth-workqueue-f460eba72132
Best regards,
--
Kevin Hao <haokexin@gmail.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
2026-02-05 6:25 [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback Kevin Hao
@ 2026-02-05 8:34 ` MD Danish Anwar
2026-02-05 13:25 ` [EXTERNAL] " Meghana Malladi
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: MD Danish Anwar @ 2026-02-05 8:34 UTC (permalink / raw)
To: Kevin Hao, netdev
Cc: Roger Quadros, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Meghana Malladi, Jacob Keller,
Vadim Fedorenko, Himanshu Mittal, Simon Horman, Byungchul Park,
Markus Elfring, linux-arm-kernel
On 05/02/26 11:55 am, Kevin Hao wrote:
> Currently, both the icssg-prueth and icssg-prueth-sr1 drivers create
> a dedicated 'emac->cmd_wq' workqueue.
>
> In the icssg-prueth-sr1 driver, this workqueue is not utilized at all.
>
> In the icssg-prueth driver, the workqueue is only used to execute the
> actual processing of ndo_set_rx_mode. However, creating a dedicated
> workqueue for such a simple use case is unnecessary. To simplify the
> code, switch to using the system default workqueue instead.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
> While addressing an issue in the cpsw driver, I based my fix [1] on the
> implementation of the emac_ndo_set_rx_mode() function in icssg. During review,
> Jakub pointed out that the dedicated workqueue for the ndo_set_rx_mode
> callback might be unnecessary [2]. I subsequently used the system workqueue for
> this purpose in the cpsw driver, and it performed as expected. Therefore,
> I believe the same approach can be applied to the icssg driver. This
> patch aim to remove this dedicated workqueue for icssg drivers.
>
> Please note: I do not have access to a board that supports the CSSG PRU
> Ethernet controller, so this change has only been build-tested.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=c0b5dc73a38f954e780f93a549b8fe225235c07a
> [2] https://lore.kernel.org/all/20260127190836.6a420768@kernel.org/
> ---
> Cc: MD Danish Anwar <danishanwar@ti.com>
> Cc: Roger Quadros <rogerq@kernel.org>
> Cc: Andrew Lunn <andrew+netdev@lunn.ch>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Meghana Malladi <m-malladi@ti.com>
> Cc: Jacob Keller <jacob.e.keller@intel.com>
> Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> Cc: Himanshu Mittal <h-mittal1@ti.com>
> Cc: Simon Horman <horms@kernel.org>
> Cc: Byungchul Park <byungchul@sk.com>
> Cc: Markus Elfring <elfring@users.sourceforge.net>
> Cc: linux-arm-kernel@lists.infradead.org
> ---
Meghana, Can you please test this patch on AM64x and verify icssg_prueth
driver functionalities.
--
Thanks and Regards,
Danish
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [EXTERNAL] [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
2026-02-05 6:25 [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback Kevin Hao
2026-02-05 8:34 ` MD Danish Anwar
@ 2026-02-05 13:25 ` Meghana Malladi
2026-02-06 5:05 ` MD Danish Anwar
2026-02-07 4:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Meghana Malladi @ 2026-02-05 13:25 UTC (permalink / raw)
To: Kevin Hao, netdev
Cc: MD Danish Anwar, Roger Quadros, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jacob Keller,
Vadim Fedorenko, Himanshu Mittal, Simon Horman, Byungchul Park,
Markus Elfring, linux-arm-kernel
On 2/5/26 11:55, Kevin Hao wrote:
> Currently, both the icssg-prueth and icssg-prueth-sr1 drivers create a
> dedicated 'emac->cmd_wq' workqueue. In the icssg-prueth-sr1 driver, this
> workqueue is not utilized at all. In the icssg-prueth driver, the
> workqueue is only used to execute
> ZjQcmQRYFpfptBannerStart
> This message was sent from outside of Texas Instruments.
> Do not click links or open attachments unless you recognize the source
> of this email and know the content is safe.
> Report Suspicious
> <https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!
> uxdqXRfPtm1bKqXPFrvrtjTYQ8PpETcsXm4BwzS8mboFbVY11ssua4wfTbejgHbxjjWn8Pd03T8mRUc-C2Ywijhr0alXjcHhfRE3zQch7w8HkSQ$>
> ZjQcmQRYFpfptBannerEnd
>
> Currently, both the icssg-prueth and icssg-prueth-sr1 drivers create
> a dedicated 'emac->cmd_wq' workqueue.
>
> In the icssg-prueth-sr1 driver, this workqueue is not utilized at all.
>
> In the icssg-prueth driver, the workqueue is only used to execute the
> actual processing of ndo_set_rx_mode. However, creating a dedicated
> workqueue for such a simple use case is unnecessary. To simplify the
> code, switch to using the system default workqueue instead.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
> While addressing an issue in the cpsw driver, I based my fix [1] on the
> implementation of the emac_ndo_set_rx_mode() function in icssg. During review,
> Jakub pointed out that the dedicated workqueue for the ndo_set_rx_mode
> callback might be unnecessary [2]. I subsequently used the system workqueue for
> this purpose in the cpsw driver, and it performed as expected. Therefore,
> I believe the same approach can be applied to the icssg driver. This
> patch aim to remove this dedicated workqueue for icssg drivers.
>
> Please note: I do not have access to a board that supports the CSSG PRU
> Ethernet controller, so this change has only been build-tested.
Based on the changes I have multicast and promiscuous modes.
logs:
https://gist.github.com/MeghanaMalladiTI/9598b33848344027772a5bf759b1bb8e
Tested-by: Meghana Malladi <m-malladi@ti.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
2026-02-05 6:25 [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback Kevin Hao
2026-02-05 8:34 ` MD Danish Anwar
2026-02-05 13:25 ` [EXTERNAL] " Meghana Malladi
@ 2026-02-06 5:05 ` MD Danish Anwar
2026-02-07 4:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: MD Danish Anwar @ 2026-02-06 5:05 UTC (permalink / raw)
To: Kevin Hao, netdev
Cc: Roger Quadros, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Meghana Malladi, Jacob Keller,
Vadim Fedorenko, Himanshu Mittal, Simon Horman, Byungchul Park,
Markus Elfring, linux-arm-kernel
On 05/02/26 11:55 am, Kevin Hao wrote:
> Currently, both the icssg-prueth and icssg-prueth-sr1 drivers create
> a dedicated 'emac->cmd_wq' workqueue.
>
> In the icssg-prueth-sr1 driver, this workqueue is not utilized at all.
>
> In the icssg-prueth driver, the workqueue is only used to execute the
> actual processing of ndo_set_rx_mode. However, creating a dedicated
> workqueue for such a simple use case is unnecessary. To simplify the
> code, switch to using the system default workqueue instead.
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
Reviewed-by: MD Danish Anwar <danishanwar@ti.com>
--
Thanks and Regards,
Danish
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
2026-02-05 6:25 [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback Kevin Hao
` (2 preceding siblings ...)
2026-02-06 5:05 ` MD Danish Anwar
@ 2026-02-07 4:40 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-07 4:40 UTC (permalink / raw)
To: Kevin Hao
Cc: netdev, danishanwar, rogerq, andrew+netdev, davem, edumazet, kuba,
pabeni, m-malladi, jacob.e.keller, vadim.fedorenko, h-mittal1,
horms, byungchul, elfring, linux-arm-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 05 Feb 2026 14:25:09 +0800 you wrote:
> Currently, both the icssg-prueth and icssg-prueth-sr1 drivers create
> a dedicated 'emac->cmd_wq' workqueue.
>
> In the icssg-prueth-sr1 driver, this workqueue is not utilized at all.
>
> In the icssg-prueth driver, the workqueue is only used to execute the
> actual processing of ndo_set_rx_mode. However, creating a dedicated
> workqueue for such a simple use case is unnecessary. To simplify the
> code, switch to using the system default workqueue instead.
>
> [...]
Here is the summary with links:
- [net-next,v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
https://git.kernel.org/netdev/net-next/c/b6e2db0ed9b9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-07 4:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05 6:25 [PATCH net-next v2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback Kevin Hao
2026-02-05 8:34 ` MD Danish Anwar
2026-02-05 13:25 ` [EXTERNAL] " Meghana Malladi
2026-02-06 5:05 ` MD Danish Anwar
2026-02-07 4:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox