From owner-freebsd-bugs@FreeBSD.ORG Mon May 8 23:30:24 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B5D4316A402 for ; Mon, 8 May 2006 23:30:24 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CE3443D48 for ; Mon, 8 May 2006 23:30:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k48NUNMn058565 for ; Mon, 8 May 2006 23:30:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k48NUNWP058564; Mon, 8 May 2006 23:30:23 GMT (envelope-from gnats) Resent-Date: Mon, 8 May 2006 23:30:23 GMT Resent-Message-Id: <200605082330.k48NUNWP058564@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, john hood , cgull@glup.org, ni@sandstorm.net Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4AD1016A422; Mon, 8 May 2006 23:24:43 +0000 (UTC) (envelope-from jh@sirocco.sandstorm.net) Received: from sirocco.sandstorm.net (ip-69-33-111-75.bos.megapath.net [69.33.111.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 968F243D5C; Mon, 8 May 2006 23:24:37 +0000 (GMT) (envelope-from jh@sirocco.sandstorm.net) Received: from sirocco.sandstorm.net (localhost [127.0.0.1]) by sirocco.sandstorm.net (8.13.3/8.13.3) with ESMTP id k48NTOQ7011773; Mon, 8 May 2006 19:29:24 -0400 (EDT) (envelope-from jh@sirocco.sandstorm.net) Received: (from jh@localhost) by sirocco.sandstorm.net (8.13.3/8.13.3/Submit) id k48NTOTI011772; Mon, 8 May 2006 19:29:24 -0400 (EDT) (envelope-from jh) Message-Id: <20060508232924.GA10461@sandstorm.net> Date: Mon, 8 May 2006 19:29:24 -0400 From: john hood To: FreeBSD-gnats-submit@FreeBSD.org Cc: phk@FreeBSD.org Subject: kern/97000: bogus "All threads purged from ugen0.1" message X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: john hood , cgull@glup.org, ni@sandstorm.net List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 May 2006 23:30:24 -0000 >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 " 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: