From owner-freebsd-current@FreeBSD.ORG Wed Apr 28 10:07:59 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCF0516A4CE for ; Wed, 28 Apr 2004 10:07:59 -0700 (PDT) Received: from ns1.interbgc.com (mail.interbgc.com [217.9.224.3]) by mx1.FreeBSD.org (Postfix) with SMTP id A0F5443D3F for ; Wed, 28 Apr 2004 10:07:58 -0700 (PDT) (envelope-from nike_d@cytexbg.com) Received: (qmail 55548 invoked from network); 28 Apr 2004 17:07:57 -0000 Received: from nike_d@cytexbg.com by keeper.interbgc.com by uid 1002 with qmail-scanner-1.14 (uvscan: v4.1.60/v4335. spamassassin: 2.63. Clear:SA:0(-4.9/8.0):. Processed in 1.335136 secs); 28 Apr 2004 17:07:57 -0000 X-Spam-Status: No, hits=-4.9 required=8.0 Received: from 213-240-206-214.ddns.cablebg.net (HELO tormentor.totalterror.net) (213.240.206.214) by mail.interbgc.com with SMTP; 28 Apr 2004 17:07:55 -0000 Received: (qmail 72904 invoked by uid 1006); 28 Apr 2004 17:13:28 -0000 Received: from nike_d@cytexbg.com by tormentor.cytexbg.com by uid 1003 with qmail-scanner-1.15 (sweep: 2.14/3.62. Clear:. Processed in 2.886602 secs); 28 Apr 2004 17:13:28 -0000 Received: from unknown (HELO phobos.totalterror.net) (10.0.0.6) by tormentor.totalterror.net with SMTP; 28 Apr 2004 17:13:25 -0000 References: Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Niki Denev To: current@freebsd.org, wpaul@freebsd.org Date: Wed, 28 Apr 2004 20:07:58 +0300 Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_mimegpg-phobos.totalterror.net-596-1083172078-0001"; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: Re: ndis0 panics -current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2004 17:07:59 -0000 This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. --=_mimegpg-phobos.totalterror.net-596-1083172078-0001 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit Niki Denev writes: > > Hello, > > Here is what i get with today cvsupped and rebuilt -CURRENT on IBM TP X31, > Kernel is GENERIC, dmesg, loader.conf, and the WinXP Centrino drivers > can be found at : http://www.totalterror.net/freebsd/ > Basically all i do is to load the if_ndis module (ndis.ko preloaded in > loader.conf) , set the ssid and wepkey and bring the interface up, and it > seems that just before the "ndis0: link up" console message, the machine > panics. > > ----------------------------------------------------------------- > [root@phobos /usr/src/sys/modules/if_ndis]# make clean && make > ... > [root@phobos /usr/src/sys/modules/if_ndis]# make load > /sbin/kldload -v /usr/src/sys/modules/if_ndis/if_ndis.ko > pci0: driver added > pci0:29:7: reprobing on driver added > pci0:31:3: reprobing on driver added > pci0:31:6: reprobing on driver added > pci1: driver added > pci2: driver added > pci2:2:0: reprobing on driver added > ndis0: mem 0xc0200000-0xc02 > 00fff irq 11 at device 2.0 on pci2 > ndis0: Reserved 0x1000 bytes for rid 0x10 type 3 at 0xc0200000 > ndis0: [GIANT-LOCKED] > can't re-use a leaf (ESS_ID)! > ndis0: NDIS API version: 5.1 > ndis0: Ethernet address: 00:04:23:92:33:23 > ndis0: 11b rates: 11Mbps 2Mbps 1Mbps > Loaded /usr/src/sys/modules/if_ndis/if_ndis.ko, id=9 > [root@phobos] /usr/src/sys/modules/if_ndis]# ifconfig ndis0 ssid my_ssid wepmode on wepkey 0x************************** up > ndis0: set filter failed: 6 > ndis0: set filter failed: 6 > ndis0: set filter failed: 6 > [root@phobos] /usr/src/sys/modules/if_ndis]#panic: lock (sleep mutex) Giant not locked @ /usr/src/sys/dev/if_ndis/if_ndis.c:1035 > at line 1038 in file /usr/src/sys/kern/subr_witness.c > cpuid = 0; > Debugger("panic") > Stopped at Debugger+0x46: xchgl %ebx,in_Debugger.0 > db> trace > Debugger(c07c28d5) at Debugger+0x46 > __panic(c07c5ee6,40e,c07c6487,c07da514,c07c1f57) at __panic+0x13d > witness_unlock(c0880980,0,c4a32f5f,40b) at witness_unlock+0xc6 > _mtx_unlock_flags(c0880980,0,c4a32f5f,40b,0) at _mtx_unlock_flags+0x67 > ndis_ticktask(c4cf4000,c43991b8,c09cd054,0,d7e3ed34) at ndis_ticktask+0x1e > ndis_runq(c09d1d1c,d7e3ed48,c09d1d1c,c09cd054,0) at ndis_runq+0x79 > fork_exit(c09cd054,c09d1d1c,d7e3ed48) at fork_exit+0xa8 > fork_trampoline() at fork_trampoline+0x8 > --- trap 0x1, eip = 0, esp = 0xd7e3ed7c, ebp = 0 --- > db> > ---------------------------------------------------------------- > p.s. the trace is written by hand > because i don't have com port. > I took a peek at if_ndis.c,(around line 1035) and without pretending to know anything about, kernel and device drivers, it seemed a little odd to me, why the order of locking is mtx_unlock(&Giant), NDIS_LOCK, NDIS_UNLOCK, mtx_lock(&Giant). So, i've switched the Giant locks places and my wireless is working again, but i'm not sure that fix is correct? anyway, here are the changes that i've made: --- sys/dev/if_ndis/if_ndis.c Wed Apr 28 19:48:32 2004 +++ sys/dev/if_ndis/if_ndis.c.orig Wed Apr 28 19:48:10 2004 @@ -1032,7 +1032,7 @@ ndis_media_state linkstate; int error, len; - mtx_unlock(&Giant); + mtx_lock(&Giant); sc = xsc; @@ -1068,7 +1068,7 @@ NDIS_UNLOCK(sc); - mtx_lock(&Giant); + mtx_unlock(&Giant); return; } --=_mimegpg-phobos.totalterror.net-596-1083172078-0001 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAj+TuHNAJ/fLbfrkRAvwwAJ4wEwxUyZ/bxsWXdpn0O7nJQgyb1ACeJcyR Fiu+eCs35Kme8FmjiOAk/Cs= =E5lJ -----END PGP SIGNATURE----- --=_mimegpg-phobos.totalterror.net-596-1083172078-0001--