kern/114646: [patch] firewire0: device physically ejected?
Cristian KLEIN
cristi at net.utcluj.ro
Tue Jul 17 01:20:02 UTC 2007
>Number: 114646
>Category: kern
>Synopsis: [patch] firewire0: device physically ejected?
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Jul 17 01:20:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Cristian KLEIN
>Release: 7.0-CURRENT
>Organization:
Technical University of Cluj-Napoca
>Environment:
FreeBSD hades.local 7.0-CURRENT FreeBSD 7.0-CURRENT #10: Mon Jul 16 22:41:04 EEST 2007 cristi at hades.local:/usr/obj/usr/src/sys/GENERIC i386
(source updated immediately before compile)
>Description:
When suspending / resuming my laptop (IBM Thinkpad R51) several times, it repeatedly prints the following message (written by hand):
fwohci0: device physically ejected?
The output of this message is so fast that the system is unusable.
>How-To-Repeat:
Compile a recent 7.0-CURRENT on a Laptop with firewire. Resume / suspend repeatedly.
>Fix:
Using a printf, I found out that fwohci_check_stat is called from fwohci_poll. Presumably, fwohci is not suspended or resumed correctly and the polling code repeatedly calls device_printf. I can't say for sure, but I assume the problem occurs during suspend, because the message flood starts few seconds before the laptop is actually suspended, and continues after resuming.
Why fwohci is not suspended/resumed correctly is unknown to me, but the following patch will rate-limit that message, so the system becomes usable after resuming. I don't think that fwohci is reinitialized correctly, but as I don't have any firewire device, I can't say for sure.
Anyway, after applying the patch below (and some other ACPI related patch), I was able to suspend / resume my laptop 20+ times.
Patch attached with submission follows:
--- sys/dev/firewire/fwohci.c.orig 2007-07-17 03:55:48.066278814 +0300
+++ sys/dev/firewire/fwohci.c 2007-07-17 03:58:20.899005320 +0300
@@ -2064,8 +2064,13 @@
stat = OREAD(sc, FWOHCI_INTSTAT);
if (stat == 0xffffffff) {
- device_printf(sc->fc.dev,
- "device physically ejected?\n");
+ /* Rate limit this message */
+ static int verbose = 10;
+ if (verbose != 0) {
+ device_printf(sc->fc.dev,
+ "device physically ejected?\n");
+ verbose--;
+ }
return (FILTER_STRAY);
}
if (stat)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list