Commit 2149c50b authored by Florian Fainelli's avatar Florian Fainelli Committed by Kleber Sacilotto de Souza

net: dsa: Do not suspend/resume closed slave_dev

BugLink: https://bugs.launchpad.net/bugs/1791953

[ Upstream commit a94c689e ]

If a DSA slave network device was previously disabled, there is no need
to suspend or resume it.

Fixes: 24462549 ("net: dsa: allow switch drivers to implement suspend/resume hooks")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 9f5b06d7
......@@ -1099,6 +1099,9 @@ int dsa_slave_suspend(struct net_device *slave_dev)
{
struct dsa_slave_priv *p = netdev_priv(slave_dev);
if (!netif_running(slave_dev))
return 0;
netif_device_detach(slave_dev);
if (p->phy) {
......@@ -1116,6 +1119,9 @@ int dsa_slave_resume(struct net_device *slave_dev)
{
struct dsa_slave_priv *p = netdev_priv(slave_dev);
if (!netif_running(slave_dev))
return 0;
netif_device_attach(slave_dev);
if (p->phy) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment