Subject: Re: T60 status: speedstep works, ACPI S1 fails, S3 locks hard
To: Jason Thorpe <thorpej@shagadelic.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-i386
Date: 10/12/2006 20:59:48
--tThc/1wpZn/ma/RB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Oct 11, 2006 at 09:18:45PM -0700, Jason Thorpe wrote:
> 
> On Oct 11, 2006, at 1:31 PM, Greg Troxel wrote:
> 
> >The builtin wm(4) sort of works, but PHY programming is clearly wrong.
> >I have to set media manually to 10baseT and then it will work; even
> >then after setting to 100baseTX my switch reports it's still at 10.
> >Now it's finding makphy0 at wm0, but behaves much the same as earlier
> >current.
> 
> I'm pretty sure I know how to fix this.  I'll see about a patch tonight.

The attached patch fixes this issue for me.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--tThc/1wpZn/ma/RB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.mii"

Index: makphy.c
===================================================================
RCS file: /cvsroot/src/sys/dev/mii/makphy.c,v
retrieving revision 1.19
diff -u -r1.19 makphy.c
--- makphy.c	12 Oct 2006 01:31:25 -0000	1.19
+++ makphy.c	12 Oct 2006 18:50:31 -0000
@@ -199,6 +199,15 @@
 			break;
 
 		mii_phy_setmedia(sc);
+		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
+			/*
+			 * when not in auto mode, we need to restart nego
+			 * anyway, or a switch from a fixed mode to another
+			 * fixed mode may not be seen by the switch.
+			 */
+			PHY_WRITE(sc, MII_BMCR,
+			    PHY_READ(sc, MII_BMCR) | BMCR_STARTNEG);
+		}
 		break;
 
 	case MII_TICK:

--tThc/1wpZn/ma/RB--