[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201115074210.23605-1-vee.khee.wong@intel.com>
Date: Sun, 15 Nov 2020 15:42:10 +0800
From: Wong Vee Khee <vee.khee.wong@...el.com>
To: Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...com>,
Jose Abreu <joabreu@...opsys.com>,
"David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>
Cc: netdev@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Ong Boon Leong <boon.leong.ong@...el.com>,
Voon Wei Feng <weifeng.voon@...el.com>,
Wong Vee Khee <vee.khee.wong@...el.com>,
Christophe ROULLIER <christophe.roullier@...com>
Subject: [PATCH v2 net 1/1] net: stmmac: Use rtnl_lock/unlock on netif_set_real_num_rx_queues() call
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@...com>
Tested-by: Christophe ROULLIER <christophe.roullier@...com>
Cc: Alexandre TORGUE <alexandre.torgue@...com>
Reviewed-by: Ong Boon Leong <boon.leong.ong@...el.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@...el.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
Powered by blists - more mailing lists