kern/97000: bogus "All threads purged from ugen0.1" message

john hood jh at sandstorm.net
Mon May 8 23:30:24 UTC 2006


>Number:         97000
>Category:       kern
>Synopsis:       bogus "All threads purged from ugen0.1" message
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 08 23:30:23 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     john hood
>Release:        FreeBSD 6.0-RELEASE i386
>Organization:
Sandstorm Enterprises, Inc.
>Environment:

FreeBSD 6.0-RELEASE, config file quite similar to GENERIC, minor
Sandstorm hacks to things like securelevel and bpf.

Intel S815EBM1 motherboard, ICH2 southbridge, Keylok USB security dongle.

>Description:

On some devices, when the device instance is torn down, the kernel
prints the message "All threads purged from <device>" message,
regardless of whether there were actually any threads to purge.  For
us, this happens with Keylok security dongles and their pesky binary
library to access the thing; I'm guessing their library causes the
device to reconfigure on the bus.

>How-To-Repeat:

Plug in a USB device that is claimed by the ugen driver.  Plug it in.
Unplug it, and observe kernel log messages.  Google also shows this
happening for some people with USB serial ports.

>Fix:

--- /usr/src/sys/kern/kern_conf.c	Thu Oct  6 11:17:41 2005
+++ kern/kern_conf.c	Thu May  4 19:59:30 2006
@@ -660,14 +660,15 @@
 
 	csw = dev->si_devsw;
 	dev->si_devsw = NULL;	/* already NULL for SI_ALIAS */
-	while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) {
-		printf("Purging %lu threads from %s\n",
-		    dev->si_threadcount, devtoname(dev));
-		csw->d_purge(dev);
-		msleep(csw, &devmtx, PRIBIO, "devprg", hz/10);
-	}
-	if (csw != NULL && csw->d_purge != NULL)
+	if (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) {
+		while (dev->si_threadcount) {
+			printf("Purging %lu threads from %s\n",
+			       dev->si_threadcount, devtoname(dev));
+			csw->d_purge(dev);
+			msleep(csw, &devmtx, PRIBIO, "devprg", hz/10);
+		}
 		printf("All threads purged from %s\n", devtoname(dev));
+	}
 
 	dev->si_drv1 = 0;
 	dev->si_drv2 = 0;
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list