From owner-freebsd-current@FreeBSD.ORG Tue Jul 28 16:26:44 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FA8E106566C; Tue, 28 Jul 2009 16:26:44 +0000 (UTC) (envelope-from zozo@q.gid0.org) Received: from smtpfb2-g21.free.fr (smtpfb2-g21.free.fr [212.27.42.10]) by mx1.freebsd.org (Postfix) with ESMTP id 3F35F8FC14; Tue, 28 Jul 2009 16:26:41 +0000 (UTC) (envelope-from zozo@q.gid0.org) Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by smtpfb2-g21.free.fr (Postfix) with ESMTP id 5DB1BD1AAF8; Tue, 28 Jul 2009 18:09:12 +0200 (CEST) Received: from smtp4-g21.free.fr (localhost [127.0.0.1]) by smtp4-g21.free.fr (Postfix) with ESMTP id 7A8884C8147; Tue, 28 Jul 2009 18:09:01 +0200 (CEST) Received: from q.gid0.org (s.gid0.org [88.163.116.140]) by smtp4-g21.free.fr (Postfix) with ESMTP id 136E44C8164; Tue, 28 Jul 2009 18:08:59 +0200 (CEST) Received: (from zozo@localhost) by q.gid0.org (8.14.3/8.14.3/Submit) id n6SG8vKW001226; Tue, 28 Jul 2009 18:08:57 +0200 (CEST) (envelope-from zozo) Date: Tue, 28 Jul 2009 18:08:57 +0200 From: Olivier SMEDTS To: Andriy Gapon Message-ID: <20090728160857.GA1205@q.gid0.org> References: <367b2c980907270358g45a2497dh64c2734721c44fca@mail.gmail.com> <4A6EF8CD.7070305@icyb.net.ua> <1248786876.73923.6.camel@balrog.2hip.net> <200907281522.08446.hselasky@c2i.net> <4A6EFEE7.3090102@icyb.net.ua> <1248788421.73923.7.camel@balrog.2hip.net> <1248789145.73923.10.camel@balrog.2hip.net> <4A6F08CE.8010605@icyb.net.ua> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4A6F08CE.8010605@icyb.net.ua> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: Alfred Perlstein , freebsd-current@FreeBSD.org, Robert Noland , Hans Petter Selasky Subject: Re: Disable root mount waiting for USB X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2009 16:26:44 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 28, 2009 at 05:18:54PM +0300, Andriy Gapon wrote: > on 28/07/2009 16:52 Robert Noland said the following: > > Ok, Apparently I'm incorrect here... The man page is misleading... It > > seems that you do need to declare the TUNABLE_INT as well as change the > > CTLFLAG_RW to CTLFLAG_RDTUN. Attached patch tested, works as expected. > > Yes, the former change is "cosmetics" (very useful variety) that turns the sysctl > into read-only one (because changing it after boot would have no effect either > way) and provides a hint to sysctl(1) to print much friendlier and useful error > message when a user would attempt to change the value. > > -- > Andriy Gapon -- Olivier Smedts _ ASCII ribbon campaign ( ) e-mail: olivier@gid0.org - against HTML email & vCards X www: http://www.gid0.org - against proprietary attachments / \ "Il y a seulement 10 sortes de gens dans le monde : ceux qui comprennent le binaire, et ceux qui ne le comprennent pas." --jRHKVT23PllUwdXP Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline; filename=patch Content-Transfer-Encoding: 8bit Index: sys/dev/usb/controller/usb_controller.c =================================================================== --- sys/dev/usb/controller/usb_controller.c (révision 195918) +++ sys/dev/usb/controller/usb_controller.c (copie de travail) @@ -79,6 +79,11 @@ "Debug level"); #endif +static int usb_no_boot_wait = 0; +SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, + "No device enumerate waiting at boot."); +TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); + static uint8_t usb_post_init_called = 0; static devclass_t usb_devclass; @@ -132,8 +137,10 @@ return (ENXIO); } - /* delay vfs_mountroot until the bus is explored */ - bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); + if (usb_no_boot_wait == 0) { + /* delay vfs_mountroot until the bus is explored */ + bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); + } if (usb_post_init_called) { mtx_lock(&Giant); --jRHKVT23PllUwdXP--