From jh@sirocco.sandstorm.net  Wed May 17 19:06:18 2006
Return-Path: <jh@sirocco.sandstorm.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5DD5716A628
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 17 May 2006 19:06:18 +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 988D543D46
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 17 May 2006 19:06:17 +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 k4HJBe41086551;
	Wed, 17 May 2006 15:11:40 -0400 (EDT)
	(envelope-from jh@sirocco.sandstorm.net)
Received: (from jh@localhost)
	by sirocco.sandstorm.net (8.13.3/8.13.3/Submit) id k4HJBd8c086550;
	Wed, 17 May 2006 15:11:39 -0400 (EDT)
	(envelope-from jh)
Message-Id: <20060517191139.GA86009@sandstorm.net>
Date: Wed, 17 May 2006 15:11:39 -0400
From: john hood <jh@sandstorm.net>
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc: cgull@glup.org, ni@sandstorm.net, FreeBSD-gnats-submit@freebsd.org
In-Reply-To: <28940.1147846152@critter.freebsd.dk>
Subject: Re: bogus "All threads purged from ugen0.1" message
References: <20060508232924.GA10461@sandstorm.net> <28940.1147846152@critter.freebsd.dk>

>Number:         97414
>Category:       kern
>Synopsis:       Re: kern/97000: bogus "All threads purged from ugen0.1" message
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 17 19:10:19 GMT 2006
>Closed-Date:    Wed May 24 21:15:25 GMT 2006
>Last-Modified:  Wed May 24 21:15:25 GMT 2006
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 On Wed, May 17, 2006 at 08:09:12AM +0200, Poul-Henning Kamp wrote:
 > In message <20060508232924.GA10461@sandstorm.net>, john hood writes:
 > 
 > >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.
 > 
 > Your patch is not correct, csw->d_purge() needs to be called in all
 > cases, but I agree that the message has outlived its purpose in
 > the zero threads case.
 > 
 > Will fix.
 
 Um.  I think you mean something like "d_purge() needs to be called at
 least once, if set, after all threads have exited".  Is that right?
 But your code (and mine) doesn't do that.  If dev->si_threadcount ==
 0, d_purge() doesn't get called at all.
 
 What I'm getting in syslog:
 
 Apr 13 12:15:51 releng kernel: ugen0: BPT Ent Dongle?Dong, rev 1.01/0.00, addr 2
 [...]
 Apr 13 13:40:46 releng kernel: All threads purged from ugen0.1
 Apr 13 13:40:48 releng last message repeated 23 times
 Apr 13 13:50:19 releng kernel: All threads purged from ugen0.1
 Apr 13 13:50:21 releng last message repeated 23 times
 
 I never get "Purging %lu threads from %s".  
 
 Google "all threads purged" and you'll see other people getting this,
 and people getting similar behavior on USB serial devices.
 
 So this may be an actual bug leaking USB pipes and tty structs.
 
 Also, the code calls d_purge(), sleeps, and then tests
 dev->si_threadcount.
 
   --jh
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed May 24 21:14:41 UTC 2006 
State-Changed-Why:  
Misfiled followup to kern/97000; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed May 24 21:14:41 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=97414 
>Unformatted:
