On 06/30/14 06:01, Lundberg, Johannes wrote:
As I mention in earlier mail, it is when I comment out following lines it
works

# For full debugger support use (turn off in stable branch):
options         DDB                     # Support DDB.
options         GDB                     # Support remote GDB.
options         DEADLKRES               # Enable the deadlock resolver
options         INVARIANTS              # Enable calls of extra sanity
checking
options         INVARIANT_SUPPORT       # Extra sanity checks of internal
structures, required by INVARIANTS
options         WITNESS                 # Enable checks to detect deadlocks
and cycles
options         WITNESS_SKIPSPIN        # Don't run witness on spinlocks
for speed
options         MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones


I have tried different levels of debugging and I have narrowed it down to
INVARIANTS.


Hi,

What happens if you put ucom and uhso in the kernel config file, instead of loading them as modules.

Please find attached a patch you can try. It ensures that the ucom mtx is not destroyed before we are finished using it at shutdown.

--HPS

=== dev/usb/serial/usb_serial.c
==================================================================
--- dev/usb/serial/usb_serial.c	(revision 268010)
+++ dev/usb/serial/usb_serial.c	(local)
@@ -200,7 +200,7 @@
 
 	mtx_destroy(&ucom_mtx);
 }
-SYSUNINIT(ucom_uninit, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_uninit, NULL);
+SYSUNINIT(ucom_uninit, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_uninit, NULL);
 
 /*
  * Mark a unit number (the X in cuaUX) as in use.
=== dev/usb/serial/usb_serial.h
==================================================================
--- dev/usb/serial/usb_serial.h	(revision 268010)
+++ dev/usb/serial/usb_serial.h	(local)
@@ -195,7 +195,7 @@
 #define	UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx)
 #define	UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx)
 #define	UCOM_UNLOAD_DRAIN(x) \
-SYSUNINIT(var, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_drain_all, 0)
+SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0)
 
 #define	ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \
     usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo)
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to