* [PATCH net-next] net: ethernet: mtk_eth_soc: remove cpu_relax in mtk_pending_work
@ 2022-11-16 23:58 Lorenzo Bianconi
2022-11-18 12:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2022-11-16 23:58 UTC (permalink / raw)
To: netdev
Cc: nbd, john, sean.wang, Mark-MC.Lee, davem, edumazet, kuba, pabeni,
lorenzo.bianconi
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 <lorenzo@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index f3a03d6f1a92..cdc0ff596196 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3546,11 +3546,8 @@ static void mtk_pending_work(struct 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])
@@ -3584,7 +3581,7 @@ static void mtk_pending_work(struct 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();
}
--
2.38.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: ethernet: mtk_eth_soc: remove cpu_relax in mtk_pending_work
2022-11-16 23:58 [PATCH net-next] net: ethernet: mtk_eth_soc: remove cpu_relax in mtk_pending_work Lorenzo Bianconi
@ 2022-11-18 12:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-18 12:10 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: netdev, nbd, john, sean.wang, Mark-MC.Lee, davem, edumazet, kuba,
pabeni, lorenzo.bianconi
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Thu, 17 Nov 2022 00:58:46 +0100 you wrote:
> 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 <lorenzo@kernel.org>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
Here is the summary with links:
- [net-next] net: ethernet: mtk_eth_soc: remove cpu_relax in mtk_pending_work
https://git.kernel.org/netdev/net-next/c/ec8cd134eeee
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] 2+ messages in thread
end of thread, other threads:[~2022-11-18 12:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 23:58 [PATCH net-next] net: ethernet: mtk_eth_soc: remove cpu_relax in mtk_pending_work Lorenzo Bianconi
2022-11-18 12:10 ` 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;
as well as URLs for NNTP newsgroup(s).