123456789101112131415161718192021222324252627282930313233343536 |
- From: Lorenzo Bianconi <[email protected]>
- Date: Thu, 17 Nov 2022 00:58:46 +0100
- Subject: [PATCH] net: ethernet: mtk_eth_soc: remove cpu_relax in
- mtk_pending_work
- Get rid of cpu_relax in mtk_pending_work routine since MTK_RESETTING is
- set only in mtk_pending_work() and it runs holding rtnl lock
- Signed-off-by: Lorenzo Bianconi <[email protected]>
- Signed-off-by: David S. Miller <[email protected]>
- ---
- --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
- +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
- @@ -3422,11 +3422,8 @@ static void mtk_pending_work(struct work
- rtnl_lock();
-
- dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
- + set_bit(MTK_RESETTING, ð->state);
-
- - while (test_and_set_bit_lock(MTK_RESETTING, ð->state))
- - cpu_relax();
- -
- - dev_dbg(eth->dev, "[%s][%d] mtk_stop starts\n", __func__, __LINE__);
- /* stop all devices to make sure that dma is properly shut down */
- for (i = 0; i < MTK_MAC_COUNT; i++) {
- if (!eth->netdev[i])
- @@ -3460,7 +3457,7 @@ static void mtk_pending_work(struct work
-
- dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
-
- - clear_bit_unlock(MTK_RESETTING, ð->state);
- + clear_bit(MTK_RESETTING, ð->state);
-
- rtnl_unlock();
- }
|