net: dsa: Do not suspend/resume closed slave_dev
Subsystems (3)
PATCH 1/1 net: dsa: Do not suspend/resume closed slave_dev
If a DSA slave network device was previously disabled, there is no need to suspend or resume it.
Fixes 2446254915a7 ("net: dsa: allow switch drivers to implement suspend/resume hooks")
Signed-off-by Florian Fainelli <[email protected]>
--- net/dsa/slave.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/dsa/slave.c +6 -0
@@ -1248,6 +1248,9 @@ int dsa_slave_suspend(struct net_device *slave_dev) {struct dsa_port *dp =dsa_slave_to_port (slave_dev); +if (!netif_running (slave_dev)) +return 0 ; +netif_device_detach (slave_dev);rtnl_lock ();
@@ -1261,6 +1264,9 @@ int dsa_slave_resume(struct net_device *slave_dev) {struct dsa_port *dp =dsa_slave_to_port (slave_dev); +if (!netif_running (slave_dev)) +return 0 ; +netif_device_attach (slave_dev);rtnl_lock ();
Signature · 1 line
2.14.1
Quoted 5 lines · Florian Fainelli
If a DSA slave network device was previously disabled, there is no need to suspend or resume it.
Fixes 2446254915a7 ("net: dsa: allow switch drivers to implement suspend/resume hooks")Signed-off-by Florian Fainelli <[email protected]>
Reviewed-by Andrew Lunn <[email protected]>
Andrew
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Tue, 31 Jul 2018 17:12:52 -0700
Quoted 5 lines
If a DSA slave network device was previously disabled, there is no need to suspend or resume it.
Fixes 2446254915a7 ("net: dsa: allow switch drivers to implement suspend/resume hooks")Signed-off-by Florian Fainelli <[email protected]>
Applied and queued up for -stable.