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]
Message-Id: <1332331707-2350-1-git-send-email-w.sang@pengutronix.de>
Date:	Wed, 21 Mar 2012 13:08:27 +0100
From:	Wolfram Sang <w.sang@...gutronix.de>
To:	netdev@...r.kernel.org
Cc:	David Miller <davem@...emloft.net>,
	Wolfram Sang <w.sang@...gutronix.de>,
	Giuseppe Cavallaro <peppe.cavallaro@...com>
Subject: [PATCH] net: phy: smsc: energy saving does not work without interrupts

We discovered link detection failures using this PHY with the Freescale FEC
which does not have interrupt support yet. Disabling the energy saving mode
makes all go well. It should be possible to make this mode work without
interrupts by adding some code dealing with the ENERGYON flag. Since adding
interrupt support to the FEC driver seems to be the better solution for us, I
want to at least make sure the PHY works reliably always. So, disable energy
saving if there is no interrupt support.

Signed-off-by: Wolfram Sang <w.sang@...gutronix.de>
Cc: Giuseppe Cavallaro <peppe.cavallaro@...com>
---

Giuseppe: Did you test with interrupts? Do you agree?

If Giuseppe is fine with the patch, this should probably be tagged for stable.

 drivers/net/phy/smsc.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index fc3e7e9..6dcf57a 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -43,16 +43,18 @@ static int smsc_phy_ack_interrupt(struct phy_device *phydev)
 
 static int smsc_phy_config_init(struct phy_device *phydev)
 {
-	int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
-	if (rc < 0)
-		return rc;
-
-	/* Enable energy detect mode for this SMSC Transceivers */
-	rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
-		       rc | MII_LAN83C185_EDPWRDOWN);
-	if (rc < 0)
-		return rc;
-
+	/* TODO: add code to make EDPWRDOWN work without interrupts */
+	if (PHY_INTERRUPT_ENABLED == phydev->interrupts) {
+		int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS);
+		if (rc < 0)
+			return rc;
+
+		/* Enable energy detect mode for this SMSC Transceivers */
+		rc = phy_write(phydev, MII_LAN83C185_CTRL_STATUS,
+			       rc | MII_LAN83C185_EDPWRDOWN);
+		if (rc < 0)
+			return rc;
+	}
 	return smsc_phy_ack_interrupt (phydev);
 }
 
-- 
1.7.9.1

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