From owner-svn-src-head@FreeBSD.ORG Tue Jul 1 07:30:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0AD3541; Tue, 1 Jul 2014 07:30:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE64C2E98; Tue, 1 Jul 2014 07:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s617UUeO011077; Tue, 1 Jul 2014 07:30:30 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s617UU3H011075; Tue, 1 Jul 2014 07:30:30 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407010730.s617UU3H011075@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 1 Jul 2014 07:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268080 - head/sys/dev/usb/serial X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jul 2014 07:30:30 -0000 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)