Date: Tue, 17 Jul 2007 01:11:11 GMT From: Cristian KLEIN <cristi@net.utcluj.ro> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/114646: [patch] firewire0: device physically ejected? Message-ID: <200707170111.l6H1BBCl005022@www.freebsd.org> Resent-Message-ID: <200707170120.l6H1K2mC009826@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707170111.l6H1BBCl005022>