Skip to content

Commit 4ccfd63

Browse files
grygoriySdavem330
authored andcommitted
net: ethernet: ti: cpsw: fix ASSERT_RTNL() warning during resume
netif_set_real_num_tx/rx_queues() are required to be called with rtnl_lock taken, otherwise ASSERT_RTNL() warning will be triggered - which happens now during System resume from suspend: cpsw_resume() |- cpsw_ndo_open() |- netif_set_real_num_tx/rx_queues() |- ASSERT_RTNL(); Hence, fix it by surrounding cpsw_ndo_open() by rtnl_lock/unlock() calls. Cc: Dave Gerlach <d-gerlach@ti.com> Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Fixes: commit e05107e ("net: ethernet: ti: cpsw: add multi queue support") Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Tested-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e2d2afe commit 4ccfd63

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/net/ethernet/ti/cpsw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,6 +2930,8 @@ static int cpsw_resume(struct device *dev)
29302930
/* Select default pin state */
29312931
pinctrl_pm_select_default_state(dev);
29322932

2933+
/* shut up ASSERT_RTNL() warning in netif_set_real_num_tx/rx_queues */
2934+
rtnl_lock();
29332935
if (cpsw->data.dual_emac) {
29342936
int i;
29352937

@@ -2941,6 +2943,8 @@ static int cpsw_resume(struct device *dev)
29412943
if (netif_running(ndev))
29422944
cpsw_ndo_open(ndev);
29432945
}
2946+
rtnl_unlock();
2947+
29442948
return 0;
29452949
}
29462950
#endif

0 commit comments

Comments
 (0)