* [PATCH v2 net 1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call
@ 2020-11-15 7:42 Wong Vee Khee
2020-11-17 0:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Wong Vee Khee @ 2020-11-15 7:42 UTC (permalink / raw)
To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
David S . Miller, Jakub Kicinski, Maxime Coquelin
Cc: Voon Wei Feng, Wong Vee Khee, netdev, linux-kernel,
Christophe ROULLIER, Ong Boon Leong, linux-stm32,
linux-arm-kernel
Fix an issue where dump stack is printed on suspend resume flow due to
netif_set_real_num_rx_queues() is not called with rtnl_lock held().
Fixes: 686cff3d7022 ("net: stmmac: Fix incorrect location to set real_num_rx|tx_queues")
Reported-by: Christophe ROULLIER <christophe.roullier@st.com>
Tested-by: Christophe ROULLIER <christophe.roullier@st.com>
Cc: Alexandre TORGUE <alexandre.torgue@st.com>
Reviewed-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@intel.com>
---
v2 changelog:
- Move rtnl_lock() before priv->lock and release it after to avoid a
possible ABBA deadlock scenario.
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index ba855465a2db..c8770e9668a1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5272,6 +5272,7 @@ int stmmac_resume(struct device *dev)
return ret;
}
+ rtnl_lock();
mutex_lock(&priv->lock);
stmmac_reset_queues_param(priv);
@@ -5287,6 +5288,7 @@ int stmmac_resume(struct device *dev)
stmmac_enable_all_queues(priv);
mutex_unlock(&priv->lock);
+ rtnl_unlock();
if (!device_may_wakeup(priv->device) || !priv->plat->pmt) {
rtnl_lock();
--
2.17.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 net 1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call
2020-11-15 7:42 [PATCH v2 net 1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call Wong Vee Khee
@ 2020-11-17 0:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-11-17 0:20 UTC (permalink / raw)
To: Wong Vee Khee
Cc: alexandre.torgue, weifeng.voon, netdev, christophe.roullier,
linux-kernel, linux-stm32, joabreu, mcoquelin.stm32, kuba,
boon.leong.ong, peppe.cavallaro, davem, linux-arm-kernel
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Sun, 15 Nov 2020 15:42:10 +0800 you wrote:
> Fix an issue where dump stack is printed on suspend resume flow due to
> netif_set_real_num_rx_queues() is not called with rtnl_lock held().
>
> Fixes: 686cff3d7022 ("net: stmmac: Fix incorrect location to set real_num_rx|tx_queues")
> Reported-by: Christophe ROULLIER <christophe.roullier@st.com>
> Tested-by: Christophe ROULLIER <christophe.roullier@st.com>
> Cc: Alexandre TORGUE <alexandre.torgue@st.com>
> Reviewed-by: Ong Boon Leong <boon.leong.ong@intel.com>
> Signed-off-by: Wong Vee Khee <vee.khee.wong@intel.com>
>
> [...]
Here is the summary with links:
- [v2,net,1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call
https://git.kernel.org/netdev/net/c/8e5debed3901
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-17 0:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-15 7:42 [PATCH v2 net 1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call Wong Vee Khee
2020-11-17 0:20 ` 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).