Thread (8 messages) 8 messages, 4 authors, 2015-07-31

Re: [PATCH v2] net/phy: micrel: Reenable interrupts during resume

flat view

From: Sergei Shtylyov <hidden>
Date: 2015-07-30 18:01:05
Also in: lkml

Hello.

On 07/30/2015 06:15 PM, Nathan Sullivan wrote:
The ksz9031 has a behavior where it will clear the interrupt enable bits
when leaving power down.  To work around this, make sure the interrupt
bits are in the state they are expected to be when resuming.
Signed-off-by: Nathan Sullivan <redacted>
---
Changes for V2: Actually make sure it compiles this time.
quoted hunk ↗ jump to hunk
---
  drivers/net/phy/micrel.c |   18 +++++++++++++++++-
  1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 499185e..9774582 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -447,6 +447,22 @@ static int ksz9031_center_flp_timing(struct phy_device *phydev)
  	return genphy_restart_aneg(phydev);
  }

+static int ksz9031_resume(struct phy_device *phydev)
+{
+	int result;
+
+	result = genphy_resume(phydev);
+
   I don't think empty line is needed here. Sorry for missing it in the first posting...
quoted hunk ↗ jump to hunk
+	if (result)
+		return result;
+
+	/* This phy will reset interrupt enables when leaving power down */
+	if (PHY_INTERRUPT_ENABLED & phydev->interrupts)
+		result = kszphy_config_intr(phydev);
+
+	return result;
+}
+
[...]

WBR, Sergei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help