1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Thu, 17 Nov 2022 00:58:46 +0100
3 Subject: [PATCH] net: ethernet: mtk_eth_soc: remove cpu_relax in
6 Get rid of cpu_relax in mtk_pending_work routine since MTK_RESETTING is
7 set only in mtk_pending_work() and it runs holding rtnl lock
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Signed-off-by: David S. Miller <davem@davemloft.net>
13 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
14 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
15 @@ -3437,11 +3437,8 @@ static void mtk_pending_work(struct work
18 dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
19 + set_bit(MTK_RESETTING, ð->state);
21 - while (test_and_set_bit_lock(MTK_RESETTING, ð->state))
24 - dev_dbg(eth->dev, "[%s][%d] mtk_stop starts\n", __func__, __LINE__);
25 /* stop all devices to make sure that dma is properly shut down */
26 for (i = 0; i < MTK_MAC_COUNT; i++) {
28 @@ -3475,7 +3472,7 @@ static void mtk_pending_work(struct work
30 dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
32 - clear_bit_unlock(MTK_RESETTING, ð->state);
33 + clear_bit(MTK_RESETTING, ð->state);