Skip to content

Commit ec8cd13

Browse files
LorenzoBianconidavem330
authored andcommitted
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]>
1 parent b677d6c commit ec8cd13

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/net/ethernet/mediatek/mtk_eth_soc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3546,11 +3546,8 @@ static void mtk_pending_work(struct work_struct *work)
35463546
rtnl_lock();
35473547

35483548
dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
3549+
set_bit(MTK_RESETTING, &eth->state);
35493550

3550-
while (test_and_set_bit_lock(MTK_RESETTING, &eth->state))
3551-
cpu_relax();
3552-
3553-
dev_dbg(eth->dev, "[%s][%d] mtk_stop starts\n", __func__, __LINE__);
35543551
/* stop all devices to make sure that dma is properly shut down */
35553552
for (i = 0; i < MTK_MAC_COUNT; i++) {
35563553
if (!eth->netdev[i])
@@ -3584,7 +3581,7 @@ static void mtk_pending_work(struct work_struct *work)
35843581

35853582
dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
35863583

3587-
clear_bit_unlock(MTK_RESETTING, &eth->state);
3584+
clear_bit(MTK_RESETTING, &eth->state);
35883585

35893586
rtnl_unlock();
35903587
}

0 commit comments

Comments
 (0)