From owner-freebsd-stable@FreeBSD.ORG Sun Jun 4 23:52:09 2006 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DB0A16A7EA for ; Sun, 4 Jun 2006 23:52:09 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from grunt14.ihug.co.nz (grunt14.ihug.co.nz [203.109.254.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCFF843D5E for ; Sun, 4 Jun 2006 23:52:06 +0000 (GMT) (envelope-from thompsa@freebsd.org) Received: from 203-109-251-39.static.bliink.ihug.co.nz (heff.fud.org.nz) [203.109.251.39] by grunt14.ihug.co.nz with smtp (Exim 3.35 #1 (Debian)) id 1Fn2O5-0002zk-00; Mon, 05 Jun 2006 11:52:05 +1200 Received: by heff.fud.org.nz (Postfix, from userid 1001) id 5D3331CC1F; Mon, 5 Jun 2006 11:52:04 +1200 (NZST) Date: Mon, 5 Jun 2006 11:52:04 +1200 From: Andrew Thompson To: freebsd-stable@freebsd.org Message-ID: <20060604235204.GA3762@heff.fud.org.nz> References: <447E5C74.4070208@samsco.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <447E5C74.4070208@samsco.org> User-Agent: Mutt/1.5.11 Cc: iedowse@freebsd.org, Scott Ullrich Subject: Re: panic: trying to sleep while sleeping is prohibited - USB network panic after ifconfig X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jun 2006 23:52:09 -0000 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 31, 2006 at 09:18:12PM -0600, Scott Long wrote: > This looks like a pretty fundamental problem with the aue driver. > I have a patch attached that will hopefully fix it. I dont have the hardware so anyone with an aue adapter please test. > Scott Ullrich wrote: > > >Sleeping on "usbsyn" with the following non-sleepable locks held: > >exclusive sleep mutex in_multi_mtx r = 0 (0xc0acfbc0) locked @ > >/usr/src/sys/neti > >net/in.c:971 > >KDB: stack backtrace: > >kdb_backtrace(1,c27e5418,c27e7000,1,ccfe3a50) at kdb_backtrace+0x29 > >witness_warn(5,0,c0993d00,c09846cb) at witness_warn+0x18e > >msleep(c27ffb00,0,4c,c09846cb,0) at msleep+0x42 > >usbd_transfer(c27ffb00,ccfe3ab0,c0649b2d,c27ffb00,c24a1580) at > >usbd_transfer+0x1 > >21 > >usbd_sync_transfer(c27ffb00,c24a1580,ccfe3acc,c06c6ea4,c25d0a00) at > >usbd_sync_tr > >ansfer+0x11 > >usbd_do_request_flags_pipe(c257d600,c257d280,ccfe3b0c,ccfe3b0b,0) at > >usbd_do_req > >uest_flags_pipe+0x5d > >usbd_do_request_flags(c257d600,ccfe3b0c,ccfe3b0b,0,0) at > >usbd_do_request_flags+0 > >x20 > >usbd_do_request(c257d600,ccfe3b0c,ccfe3b0b) at usbd_do_request+0x1a > >aue_csr_read_1(c25d0a00,0) at aue_csr_read_1+0x50 > >aue_setmulti(c25d0a00,c280e280,c25d3000,ccfe3ba8,ccfe3b78) at > >aue_setmulti+0x4a > >aue_ioctl(c25d3000,80206931,0) at aue_ioctl+0x106 > >if_addmulti(c25d3000,ccfe3ba8,ccfe3ba4,ccfe3ba8,10,c0acfbc0,0,c09a3cd4,3cb) > >at i > >f_addmulti+0x1b8 > >in_addmulti(ccfe3bdc,c25d3000) at in_addmulti+0x69 > >in_ifinit(c25d3000,c27da500,c262dcd0,0,ccfe3c38) at in_ifinit+0x529 > >in_control(c28206f4,8040691a,c262dcc0,c25d3000,c27e7000) at > >in_control+0x882 > >ifioctl(c28206f4,8040691a,c262dcc0,c27e7000,0) at ifioctl+0x198 > >soo_ioctl(c2678c60,8040691a,c262dcc0,c2480780,c27e7000) at soo_ioctl+0x2db > >ioctl(c27e7000,ccfe3d04,3,2,286) at ioctl+0x370 > >syscall(3b,3b,3b,8056080,80583c0) at syscall+0x22f > >Xint0x80_syscall() at Xint0x80_syscall+0x1f > >--- syscall (54, FreeBSD ELF32, ioctl), eip = 0x28131603, esp = > >0xbfbfe59c, ebp > >= 0xbfbfede8 --- > >panic: trying to sleep while sleeping is prohibited > >cpuid = 0 > >KDB: enter: panic > >[thread pid 13 tid 100003 ] > >Stopped at kdb_enter+0x2b: nop > > > >More information (bt, bt all, show alllocks) can be found at > >http://www.pfsense.com/~sullrich/panics/usb_network_nic_panic.txt > > > >Let me know if you need any more information. > >_______________________________________________ > >freebsd-stable@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-stable > >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="if_aue.diff" Index: if_aue.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/if_aue.c,v retrieving revision 1.96 diff -u -p -r1.96 if_aue.c --- if_aue.c 14 Feb 2006 12:44:55 -0000 1.96 +++ if_aue.c 4 Jun 2006 23:42:34 -0000 @@ -524,6 +524,7 @@ aue_setmulti(struct aue_softc *sc) struct ifnet *ifp; struct ifmultiaddr *ifma; u_int32_t h = 0, i; + u_int8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; ifp = sc->aue_ifp; @@ -534,10 +535,6 @@ aue_setmulti(struct aue_softc *sc) AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_ALLMULTI); - /* first, zot all the existing hash bits */ - for (i = 0; i < 8; i++) - aue_csr_write_1(sc, AUE_MAR0 + i, 0); - /* now program new ones */ IF_ADDR_LOCK(ifp); #if __FreeBSD_version >= 500000 @@ -550,10 +547,14 @@ aue_setmulti(struct aue_softc *sc) continue; h = ether_crc32_le(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), ETHER_ADDR_LEN) & ((1 << AUE_BITS) - 1); - AUE_SETBIT(sc, AUE_MAR + (h >> 3), 1 << (h & 0x7)); + hashtbl[(h >> 3)] |= 1 << (h & 0x7); } IF_ADDR_UNLOCK(ifp); + /* write the hashtable */ + for (i = 0; i < 8; i++) + aue_csr_write_1(sc, AUE_MAR0 + i, hashtbl[i]); + return; } --RnlQjJ0d97Da+TV1--