Date: Tue, 27 Dec 2005 11:17:13 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-hardware@freebsd.org Cc: Adriaan de Groot <groot@kde.org>, Alexander Konovalenko <kono@kth.se>, freebsd-acpi@freebsd.org Subject: Re: "no carrier" on vr0 caused by suspend (FreeBSD 6.0) Message-ID: <200512271117.15361.jhb@freebsd.org> In-Reply-To: <200512262237.02342.groot@kde.org> References: <20051226172520.V29157@omega.nanophys.kth.se> <200512262237.02342.groot@kde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 26 December 2005 04:36 pm, Adriaan de Groot wrote: > On Monday 26 December 2005 17:44, Alexander Konovalenko wrote: > > recently I have upgraded my AMD Athlono-XP laptop to 6.0 STABLE, > > everything works fine, even suspending with zzz works except > > network interface vr0 which is in state "no carrier" right after wake up. > > The only thing which helps is reboot. > > I just finished working on a Via C3-mini ITX box, also with a vr0 > interface; it's not a laptop, but I felt it needed to suspend anyway. > Suspend into S3 causes the vr0 to hang on resume, in my case with regular > vr0: watchdog timeout messages. > > Solution: reset the driver. > > Implementation: build a custom kernel with _no_ vr interface built in. Make > sure vr is built as a module. In the suspend script, unload the module. In > resume, reload it, then run rc.d/netif and rc.d/routing. For simple > machines with uncomplicated interfaces and routing, that ought to do the > trick. You can try stopping the chip during suspend and init on resume. Something like this: Index: if_vr.c =================================================================== RCS file: /usr/cvs/src/sys/pci/if_vr.c,v retrieving revision 1.114 diff -u -r1.114 if_vr.c --- if_vr.c 11 Nov 2005 16:04:58 -0000 1.114 +++ if_vr.c 27 Dec 2005 16:16:55 -0000 @@ -132,6 +132,8 @@ static int vr_probe(device_t); static int vr_attach(device_t); static int vr_detach(device_t); +static int vr_suspend(device_t); +static int vr_resume(device_t); static int vr_newbuf(struct vr_softc *, struct vr_chain_onefrag *, struct mbuf *); @@ -182,6 +184,8 @@ DEVMETHOD(device_probe, vr_probe), DEVMETHOD(device_attach, vr_attach), DEVMETHOD(device_detach, vr_detach), + DEVMETHOD(device_suspend, vr_suspend), + DEVMETHOD(device_resume, vr_resume), DEVMETHOD(device_shutdown, vr_shutdown), /* bus interface */ @@ -830,6 +834,30 @@ return (0); } +static int +vr_suspend(device_t dev) +{ + struct vr_softc *sc = device_get_softc(dev); + + VR_LOCK(sc); + sc->suspended = 1; + vr_stop(sc); + VR_UNLOCK(sc); + return (0); +} + +static int +vr_resume(device_t dev) +{ + struct vr_softc *sc = device_get_softc(dev); + + VR_LOCK(sc); + sc->suspended = 0; + vr_init_locked(sc); + VR_UNLOCK(sc); + return (0); +} + /* * Initialize the transmit descriptors. */ -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512271117.15361.jhb>