Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jul 2014 07:30:30 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268080 - head/sys/dev/usb/serial
Message-ID:  <201407010730.s617UU3H011075@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Jul  1 07:30:29 2014
New Revision: 268080
URL: http://svnweb.freebsd.org/changeset/base/268080

Log:
  Fix order of USB serial layer uninit. Currently module dependency
  rules prevent the USB serial module to be unloaded before any client
  modules. This patch ensures that the "ucom_mtx" mutex is destroyed
  last when doing a system uninit in a monotolith build aswell.
  
  MFC after:	3 days

Modified:
  head/sys/dev/usb/serial/usb_serial.c
  head/sys/dev/usb/serial/usb_serial.h

Modified: head/sys/dev/usb/serial/usb_serial.c
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.c	Tue Jul  1 07:29:42 2014	(r268079)
+++ head/sys/dev/usb/serial/usb_serial.c	Tue Jul  1 07:30:29 2014	(r268080)
@@ -200,7 +200,7 @@ ucom_uninit(void *arg)
 
 	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.

Modified: head/sys/dev/usb/serial/usb_serial.h
==============================================================================
--- head/sys/dev/usb/serial/usb_serial.h	Tue Jul  1 07:29:42 2014	(r268079)
+++ head/sys/dev/usb/serial/usb_serial.h	Tue Jul  1 07:30:29 2014	(r268080)
@@ -195,7 +195,7 @@ struct ucom_softc {
 #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)



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