From eugen@grosbein.pp.ru  Sat Sep 22 05:13:52 2007
Return-Path: <eugen@grosbein.pp.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7D6F16A419
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Sep 2007 05:13:50 +0000 (UTC)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166])
	by mx1.freebsd.org (Postfix) with ESMTP id 164D613C461
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Sep 2007 05:13:49 +0000 (UTC)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (localhost [127.0.0.1])
	by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l8M52MlA001877
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 22 Sep 2007 13:02:22 +0800 (KRAST)
	(envelope-from eugen@grosbein.pp.ru)
Received: (from eugen@localhost)
	by grosbein.pp.ru (8.14.1/8.14.1/Submit) id l8M52Lfb001876;
	Sat, 22 Sep 2007 13:02:21 +0800 (KRAST)
	(envelope-from eugen)
Message-Id: <200709220502.l8M52Lfb001876@grosbein.pp.ru>
Date: Sat, 22 Sep 2007 13:02:21 +0800 (KRAST)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
Reply-To: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [fdc] [patch] kldunload fdc.ko locks forever due to missing wakeup()
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         116537
>Category:       kern
>Synopsis:       [fdc] [patch] kldunload fdc.ko locks forever due to missing wakeup()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kib
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 22 05:20:01 GMT 2007
>Closed-Date:    Mon Feb 25 14:42:50 UTC 2008
>Last-Modified:  Fri May 16 10:40:01 UTC 2008
>Originator:     Eugene Grosbein
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Svyaz-Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 6.2-STABLE FreeBSD 6.2-STABLE #2: Sun Sep 16 16:54:23 KRAST 2007 eu@grosbein.pp.ru:/home/obj/usr/local/src/sys/DADV i386

>Description:

	An attempt to unload kernel module fdc.ko results in
	kldunload waiting forever in state 'fdcdet'.

>How-To-Repeat:
	kldunload fdc.ko

>Fix:

--- sys/dev/fdc/fdc.c.orig	2007-09-15 16:53:23.000000000 +0800
+++ sys/dev/fdc/fdc.c	2007-09-16 16:26:07.000000000 +0800
@@ -1195,6 +1198,7 @@
 		mtx_lock(&fdc->fdc_mtx);
 	}
 	fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE);
+	wakeup(&fdc->fdc_thread);
 	mtx_unlock(&fdc->fdc_mtx);
 
 	kthread_exit(0);

>Release-Note:
>Audit-Trail:

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/116537: [fdc] [patch] kldunload fdc.ko locks forever due to missing wakeup()
Date: Sat, 10 Nov 2007 00:59:02 +0700

 Hi!
 
 This is still the problem for 7.0-BETA2.
 
 Eugene
Responsible-Changed-From-To: freebsd-bugs->kib 
Responsible-Changed-By: kib 
Responsible-Changed-When: Fri Jan 11 11:26:40 UTC 2008 
Responsible-Changed-Why:  
Take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116537 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/116537: commit references a PR
Date: Fri, 11 Jan 2008 11:53:10 +0000 (UTC)

 kib         2008-01-11 11:53:04 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/fdc          fdc.c 
   Log:
   Fix unload of the fdc.ko:
   
   Wakeup the thread doing the fdc_detach() when the fdc worker thread exits [1].
   Write access to the write-protected floppy shall call device_unbusy() to
   pair the device_busy() in the fd_access() [2].
   
   PR:     116537 [1], 116539 [2]
   MFC after:      1 week
   
   Revision  Changes    Path
   1.319     +8 -1      src/sys/dev/fdc/fdc.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: kib 
State-Changed-When: Fri Jan 11 18:10:38 UTC 2008 
State-Changed-Why:  
Yes, patch is committed finally. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116537 
State-Changed-From-To: patched->closed 
State-Changed-By: kib 
State-Changed-When: Mon Feb 25 14:41:56 UTC 2008 
State-Changed-Why:  
Patch was committed long time ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=116537 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/116537: commit references a PR
Date: Fri, 16 May 2008 10:33:02 +0000 (UTC)

 kib         2008-05-16 10:32:52 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/dev/fdc          fdc.c 
   Log:
   MFC rev. 1.320:
   
   The wakeup() line from the rev. 1.319 is wrong and reintroduces
   a panic race on module unload. The wakeup() is internal to
   kproc_exit/kthread_exit. The correct fix is to fix the msleep() in
   detach to sleep on fdc->fdc_thread instead of &fdc->fdc_thread.
   
   MFC rev. 1.319:
   Wakeup the thread doing the fdc_detach() when the fdc worker thread exits [1].
   Write access to the write-protected floppy shall call device_unbusy() to
   pair the device_busy() in the fd_access() [2].
   
   PR:     116537 [1], 116539 [2]
   
   Revision   Changes    Path
   1.307.2.5  +8 -2      src/sys/dev/fdc/fdc.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
