Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Mar 2005 22:40:38 +0900 (JST)
From:      Yoichi NAKAYAMA <yoichi@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        yoichi@FreeBSD.org
Subject:   kern/79160: xl_detach cause panic
Message-ID:  <20050323134038.C656B1E8F7@alcoholic.geiin.org>
Resent-Message-ID: <200503231350.j2NDo2tN058395@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         79160
>Category:       kern
>Synopsis:       xl_detach cause panic
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 23 13:50:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Yoichi NAKAYAMA
>Release:        FreeBSD-current
>Organization:
Geiin.org
>Environment:
	
>Description:
I'm using cardbus NIC 3CXFE575CT-AP, which uses xl driver.
When I eject the card, I met panic as follows:
panic: _mtx_lock_sleep: recursed on non-recursive mutex xl0 @ /usr/src/sys/pci/if_xl.c:3050
db> trace
kdb_enter(...)
panic(...)
_mtx_lock_sleep(...)
_mtx_lock_flags(...)
xl_ioctl(...)
if_delmulti(...)
in6_delmulti(...)
in6_purgeaddr(...)
if_detach(...)
ether_ifdetach(...)
xl_detach(...)
device_detach(...)
cardbus_detach_card(...)
cbb_removal(...)
cbb_event_thread(...)

>How-To-Repeat:
detach xl device

>Fix:
Remove lock while calling ether_ifdetach(). Almost same problem has been reported before for sys/pci/if_vr.c:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/pci/if_vr.c?rev=1.98&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
There are some other files with similar problem, perhaps.

--- src/sys/pci/if_xl.c.orig
+++ src/sys/pci/if_xl.c
@@ -1705,7 +1705,9 @@
 	if (device_is_attached(dev)) {
 		xl_reset(sc);
 		xl_stop(sc);
+		XL_UNLOCK(sc);
 		ether_ifdetach(ifp);
+		XL_LOCK(sc);
 	}
 	if (sc->xl_miibus)
 		device_delete_child(dev, sc->xl_miibus);

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050323134038.C656B1E8F7>