All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: Do not suspend/resume closed slave_dev
@ 2018-08-01  0:12 Florian Fainelli
  2018-08-01 15:25 ` Andrew Lunn
  2018-08-01 16:55 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2018-08-01  0:12 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
	open list

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 <f.fainelli@gmail.com>
---
 net/dsa/slave.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 1e3b6a6d8a40..732369c80644 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -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();
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: Do not suspend/resume closed slave_dev
  2018-08-01  0:12 [PATCH net] net: dsa: Do not suspend/resume closed slave_dev Florian Fainelli
@ 2018-08-01 15:25 ` Andrew Lunn
  2018-08-01 16:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-08-01 15:25 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, Vivien Didelot, David S. Miller, open list

On Tue, Jul 31, 2018 at 05:12:52PM -0700, Florian Fainelli wrote:
> 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 <f.fainelli@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dsa: Do not suspend/resume closed slave_dev
  2018-08-01  0:12 [PATCH net] net: dsa: Do not suspend/resume closed slave_dev Florian Fainelli
  2018-08-01 15:25 ` Andrew Lunn
@ 2018-08-01 16:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-01 16:55 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 31 Jul 2018 17:12:52 -0700

> 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 <f.fainelli@gmail.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-01 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-01  0:12 [PATCH net] net: dsa: Do not suspend/resume closed slave_dev Florian Fainelli
2018-08-01 15:25 ` Andrew Lunn
2018-08-01 16:55 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.