]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
net: ethernet: ti: cpsw: fix ASSERT_RTNL() warning during resume
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 29 Nov 2016 22:27:03 +0000 (16:27 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 19:59:08 +0000 (14:59 -0500)
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 e05107e6b747 ("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>
drivers/net/ethernet/ti/cpsw.c

index 9f06465126249cb27768fba8fd8e07a61e5e32c4..b9087b828eff6183b73ba6dfe8c92ec55655b1a9 100644 (file)
@@ -2930,6 +2930,8 @@ static int cpsw_resume(struct device *dev)
        /* Select default pin state */
        pinctrl_pm_select_default_state(dev);
 
+       /* shut up ASSERT_RTNL() warning in netif_set_real_num_tx/rx_queues */
+       rtnl_lock();
        if (cpsw->data.dual_emac) {
                int i;
 
@@ -2941,6 +2943,8 @@ static int cpsw_resume(struct device *dev)
                if (netif_running(ndev))
                        cpsw_ndo_open(ndev);
        }
+       rtnl_unlock();
+
        return 0;
 }
 #endif