lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 25 Oct 2017 16:21:22 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     netdev@...r.kernel.org
Cc:     Florian Fainelli <f.fainelli@...il.com>, davem@...emloft.net,
        andrew@...n.ch, opendmb@...il.com,
        Marc Gonzalez <marc_gonzalez@...madesigns.com>,
        slash.tmp@...e.fr, david.daney@...ium.com, geert+renesas@...der.be
Subject: [RFC net-next 2/4] net: smsc911x: Properly manage PHY during suspend/resume

Commit 2aa70f864955 ("net: smsc911x: Quieten netif during suspend")
addressed the network device parts of the suspend/resume process, but
this is not enough, we can also need to manage the PHY state machine
during suspend.

Because Geert indicated that we are going to cut the power to the block,
we need the hard synchronization that phy_stop_machine() guarantees,
conversely use phy_start_machine() to resume properly.

There appears to be a desire to enable Wake-on-LAN, which is obviously
dependent on the PHY not being suspend, so we don't suspend it. A future
patch should probably add proper support for turning on/off Wake-on-LAN
on a PHY activity/password etc. basis.

Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
---
 drivers/net/ethernet/smsc/smsc911x.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 012fb66eed8d..82f9a175073f 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -2598,6 +2598,11 @@ static int smsc911x_suspend(struct device *dev)
 	if (netif_running(ndev)) {
 		netif_stop_queue(ndev);
 		netif_device_detach(ndev);
+		phy_stop(ndev->phydev);
+		/* Use a hard synchronization here because we will cut the
+		 * power fo the block next
+		 */
+		phy_stop_machine(ndev->phydev);
 	}
 
 	/* enable wake on LAN, energy detection and the external PME
@@ -2638,6 +2643,8 @@ static int smsc911x_resume(struct device *dev)
 
 	if (netif_running(ndev)) {
 		netif_device_attach(ndev);
+		phy_start_machine(ndev->phydev);
+		phy_start(ndev->phydev);
 		netif_start_queue(ndev);
 	}
 
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ