panic: trying to sleep while sleeping is prohibited - USB network panic after ifconfig

Andrew Thompson thompsa at freebsd.org
Sun Jun 4 23:52:09 UTC 2006


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 at freebsd.org mailing list
> >http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> >To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"
> 
> _______________________________________________
> freebsd-stable at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"
-------------- next part --------------
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;
 }
 


More information about the freebsd-stable mailing list