* [PATCH] net: stmmac: Fix ASSERT_RTNL() warning on suspend/resume
@ 2019-09-17 10:02 Loys Ollivier
2019-09-17 10:12 ` Jose Abreu
0 siblings, 1 reply; 3+ messages in thread
From: Loys Ollivier @ 2019-09-17 10:02 UTC (permalink / raw)
To: Russell King, Maxime Coquelin
Cc: Loys Ollivier, Jose Abreu, David S. Miller, Giuseppe Cavallaro,
Alexandre Torgue, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
rtnl_lock needs to be taken before calling phylink_start/stop to lock the
network stack.
Fix ASSERT_RTNL() warnings by protecting such calls with lock/unlock.
Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index fd54c7c87485..485f33f57b43 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4451,7 +4451,9 @@ int stmmac_suspend(struct device *dev)
if (!ndev || !netif_running(ndev))
return 0;
+ rtnl_lock();
phylink_stop(priv->phylink);
+ rtnl_unlock();
mutex_lock(&priv->lock);
@@ -4560,7 +4562,9 @@ int stmmac_resume(struct device *dev)
mutex_unlock(&priv->lock);
+ rtnl_lock();
phylink_start(priv->phylink);
+ rtnl_unlock();
return 0;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] net: stmmac: Fix ASSERT_RTNL() warning on suspend/resume
2019-09-17 10:02 [PATCH] net: stmmac: Fix ASSERT_RTNL() warning on suspend/resume Loys Ollivier
@ 2019-09-17 10:12 ` Jose Abreu
2019-09-25 15:00 ` Loys Ollivier
0 siblings, 1 reply; 3+ messages in thread
From: Jose Abreu @ 2019-09-17 10:12 UTC (permalink / raw)
To: Loys Ollivier, Russell King, Maxime Coquelin
Cc: David S. Miller, Giuseppe Cavallaro, Alexandre Torgue, netdev,
linux-stm32, linux-arm-kernel, linux-kernel
From: Loys Ollivier <lollivier@baylibre.com>
Date: Sep/17/2019, 11:02:36 (UTC+00:00)
> rtnl_lock needs to be taken before calling phylink_start/stop to lock the
> network stack.
> Fix ASSERT_RTNL() warnings by protecting such calls with lock/unlock.
>
> Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
I already sent a fix for this. Please see in -net:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/driv
ers/net/ethernet/stmicro/stmmac?id=19e13cb27b998ff49f07e399b5871bfe5ba7e3
f0
---
Thanks,
Jose Miguel Abreu
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] net: stmmac: Fix ASSERT_RTNL() warning on suspend/resume
2019-09-17 10:12 ` Jose Abreu
@ 2019-09-25 15:00 ` Loys Ollivier
0 siblings, 0 replies; 3+ messages in thread
From: Loys Ollivier @ 2019-09-25 15:00 UTC (permalink / raw)
To: Jose Abreu, Russell King, Maxime Coquelin
Cc: David S. Miller, Giuseppe Cavallaro, Alexandre Torgue, netdev,
linux-stm32, linux-arm-kernel, linux-kernel
On Tue 17 Sep 2019 at 10:12, Jose Abreu <Jose.Abreu@synopsys.com> wrote:
> From: Loys Ollivier <lollivier@baylibre.com>
> Date: Sep/17/2019, 11:02:36 (UTC+00:00)
>
>> rtnl_lock needs to be taken before calling phylink_start/stop to lock the
>> network stack.
>> Fix ASSERT_RTNL() warnings by protecting such calls with lock/unlock.
>>
>> Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
>> Signed-off-by: Loys Ollivier <lollivier@baylibre.com>
>
> I already sent a fix for this. Please see in -net:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/driv
> ers/net/ethernet/stmicro/stmmac?id=19e13cb27b998ff49f07e399b5871bfe5ba7e3
> f0
Ah good catch :)
>
> ---
> Thanks,
> Jose Miguel Abreu
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-09-25 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 10:02 [PATCH] net: stmmac: Fix ASSERT_RTNL() warning on suspend/resume Loys Ollivier
2019-09-17 10:12 ` Jose Abreu
2019-09-25 15:00 ` Loys Ollivier
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).