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:	Tue, 13 May 2014 17:23:18 +0800
From:	Zhangfei Gao <zhangfei.gao@...aro.org>
To:	sebastian.hesselbarth@...il.com, f.fainelli@...il.com,
	davem@...emloft.net
Cc:	netdev@...r.kernel.org, Zhangfei Gao <zhangfei.gao@...aro.org>,
	Jiancheng Xue <xuejiancheng@...wei.com>
Subject: [PATCH] net: phy: resume phydev when PHY_RESUMING

Commit be9dad1f9f26604fb suspend phydev when going to HALTED.
However not to resume phydev when going to RESUMING.
BMCR_PDOWN remains set "ifconfig eth0 down" -> "ifconfig eth0 up".
Unless phy_attach_direct is called in open function.

Fix the issue via phy_resume in PHY_RESUMING

Signed-off-by: Jiancheng Xue <xuejiancheng@...wei.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@...aro.org>
---
 drivers/net/phy/phy.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 1b6d09a..be5d52e 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -715,7 +715,7 @@ void phy_state_machine(struct work_struct *work)
 	struct delayed_work *dwork = to_delayed_work(work);
 	struct phy_device *phydev =
 			container_of(dwork, struct phy_device, state_queue);
-	int needs_aneg = 0, do_suspend = 0;
+	int needs_aneg = 0, do_suspend = 0, do_resume = 0;
 	int err = 0;
 
 	mutex_lock(&phydev->lock);
@@ -865,6 +865,8 @@ void phy_state_machine(struct work_struct *work)
 			}
 			phydev->adjust_link(phydev->attached_dev);
 		}
+
+		do_resume = 1;
 		break;
 	}
 
@@ -876,6 +878,9 @@ void phy_state_machine(struct work_struct *work)
 	if (do_suspend)
 		phy_suspend(phydev);
 
+	if (do_resume)
+		phy_resume(phydev);
+
 	if (err < 0)
 		phy_error(phydev);
 
-- 
1.7.9.5

--
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