summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/mvneta.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2018-01-02 17:24:34 +0000
committerDavid S. Miller <davem@davemloft.net>2018-01-03 10:38:53 -0500
commit3b8bc67413dec0c693e6e79b41c92cf4931c8406 (patch)
treef65c48e956fa99301e44560bb8db34f7b3195e78 /drivers/net/ethernet/marvell/mvneta.c
parentd033a236bdda9f20417c66ea08bc185d9be29952 (diff)
downloadlinux-stable-3b8bc67413dec0c693e6e79b41c92cf4931c8406.tar.gz
linux-stable-3b8bc67413dec0c693e6e79b41c92cf4931c8406.tar.bz2
linux-stable-3b8bc67413dec0c693e6e79b41c92cf4931c8406.zip
net: mvneta: ensure PM paths take the rtnl lock
The netdev core always ensures that the rtnl lock is held while calling the ndo_open() and ndo_stop() methods. However, the suspend/resume paths do not hold the rtnl lock. phylink will expect the rtnl lock to be held when the MAC driver calls it, so we end up with kernel warnings. Take the lock to ensure that these functions are called in a consistent manner. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvneta.c')
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index a539263cd79c..e08bd20352cb 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4426,8 +4426,10 @@ static int mvneta_suspend(struct device *device)
struct net_device *dev = dev_get_drvdata(device);
struct mvneta_port *pp = netdev_priv(dev);
+ rtnl_lock();
if (netif_running(dev))
mvneta_stop(dev);
+ rtnl_unlock();
netif_device_detach(dev);
clk_disable_unprepare(pp->clk_bus);
clk_disable_unprepare(pp->clk);
@@ -4464,10 +4466,12 @@ static int mvneta_resume(struct device *device)
mvneta_fixed_link_update(pp, dev->phydev);
netif_device_attach(dev);
+ rtnl_lock();
if (netif_running(dev)) {
mvneta_open(dev);
mvneta_set_rx_mode(dev);
}
+ rtnl_unlock();
return 0;
}