Skip to contentSkip to conversation

sungem: Make PM of PHYs more reliable (#2)

PATCH Applied Benjamin Herrenschmidt 2 participants 2 messages Jan 22, 2006 – Jan 24, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sungem: Make PM of PHYs more reliable (#2)

On my latest laptop, I've had occasional PHY dead on wakeup from sleep... the PHY would be totally unresponsive even to toggling the hard reset line until the machine is powered down... Looking closely at the code, I found some possible issues in the way we setup the MDIO lines during suspend along with slight divergences from what Darwin does when resetting it that may explain the problem. That patch change these and the problem appear to be gone for me at least... I also fixed an mdelay -> msleep while I was at it to the pmac feature code that is called when toggling the PHY reset line since sungem doesn't call it in an atomic context anymore.

---

Ok, this is the right one this time, sorry about that.

arch/powerpc/platforms/powermac/feature.c +4 -2
Index: linux-work/arch/powerpc/platforms/powermac/feature.c
===================================================================
@@ -910,16 +910,18 @@
 	    macio->type != macio_intrepid)
 		return -ENODEV;
 
+	printk(KERN_DEBUG "Hard reset of PHY chip ...\n");
+
 	LOCK(flags);
 	MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE);
 	(void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET);
 	UNLOCK(flags);
-	mdelay(10);
+	msleep(10);
 	LOCK(flags);
 	MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */
 		KEYLARGO_GPIO_OUTOUT_DATA);
 	UNLOCK(flags);
-	mdelay(10);
+	msleep(10);
 
 	return 0;
 }
drivers/net/sungem.c +30 -25

89 lines not on this page · raw message

maintainer Applied
#1 lore raw

From: Benjamin Herrenschmidt <[email protected]>
Date: Sun, 22 Jan 2006 14:06:10 +1100

Quoted 11 lines

On my latest laptop, I've had occasional PHY dead on wakeup from sleep... the PHY would be totally unresponsive even to toggling the hard reset line until the machine is powered down... Looking closely at the code, I found some possible issues in the way we setup the MDIO lines during suspend along with slight divergences from what Darwin does when resetting it that may explain the problem. That patch change these and the problem appear to be gone for me at least... I also fixed an mdelay -> msleep while I was at it to the pmac feature code that is called when toggling the PHY reset line since sungem doesn't call it in an atomic context anymore.

Quoted 1 line

Applied, thanks Ben.