"no carrier" on vr0 caused by suspend (FreeBSD 6.0)
John Baldwin
jhb at freebsd.org
Tue Dec 27 08:16:59 PST 2005
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 at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the freebsd-acpi
mailing list