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-next>] [day] [month] [year] [list]
Date:	Thu, 27 May 2010 19:53:48 +0200
From:	Eric Bénard <eric@...rea.com>
To:	unlisted-recipients:; (no To-header on input)
Cc:	s.hauer@...gutronix.de, sshtylyov@...sta.com,
	linux-arm-kernel@...ts.infradead.org, fabioestevam@...oo.com,
	netdev@...r.kernel.org
Subject: [PATCH] net/fec: fix pm to survive to suspend/resume

* with this patch, if the connection if active before suspend, it
will be active after resume.
* before this patch, it was necessary to close the interface and
reopen it to recover the connection.

Signed-off-by: Eric Bénard <eric@...rea.com>
Cc: s.hauer@...gutronix.de
Cc: sshtylyov@...sta.com
Cc: linux-arm-kernel@...ts.infradead.org
Cc: fabioestevam@...oo.com
Cc: netdev@...r.kernel.org
---
 drivers/net/fec.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 9b4e8f7..1521972 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1974,10 +1974,11 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
 	struct fec_enet_private *fep;
 
 	if (ndev) {
-		fep = netdev_priv(ndev);
 		if (netif_running(ndev)) {
+			fep = netdev_priv(ndev);
+			netif_stop_queue(ndev);
 			netif_device_detach(ndev);
-			fec_stop(ndev);
+			clk_disable(fep->clk);
 		}
 	}
 	return 0;
@@ -1987,11 +1988,14 @@ static int
 fec_resume(struct platform_device *dev)
 {
 	struct net_device *ndev = platform_get_drvdata(dev);
+	struct fec_enet_private *fep;
 
 	if (ndev) {
 		if (netif_running(ndev)) {
-			fec_enet_init(ndev, 0);
+			fep = netdev_priv(ndev);
+			clk_enable(fep->clk);
 			netif_device_attach(ndev);
+			netif_start_queue(ndev);
 		}
 	}
 	return 0;
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ