mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback
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> Tested-by: Meghana Malladi <m-malladi@ti.com> Reviewed-by: MD Danish Anwar <danishanwar@ti.com> Link: https://patch.msgid.link/20260205-icssg-prueth-workqueue-v2-1-cf5cf97efb37@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
a35b6e4863
commit
b6e2db0ed9
4 changed files with 5 additions and 19 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @@ netdev_unregister:
|
|||
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++) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue