From owner-freebsd-current@FreeBSD.ORG Sat Oct 3 15:59:40 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 805FE1065692 for ; Sat, 3 Oct 2009 15:59:40 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.swip.net [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id 1407F8FC16 for ; Sat, 3 Oct 2009 15:59:39 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=aQey1_VUwUUA:10 a=RERtC8nhXGhYvIZhK0yWrQ==:17 a=8D9IRVj6NnbUBZQ8aCIA:9 a=kbmUsCGz2Fb6wUE6GcYb2Tq88jEA:4 Received: from [90.149.203.35] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 1138178864; Sat, 03 Oct 2009 17:59:37 +0200 From: Hans Petter Selasky To: Scott Long Date: Sat, 3 Oct 2009 18:00:23 +0200 User-Agent: KMail/1.11.4 (FreeBSD/9.0-CURRENT; KDE/4.2.4; i386; ; ) References: <20091002150931.K35591@pooker.samsco.org> <200910031230.51044.hselasky@c2i.net> In-Reply-To: X-Face: (%:6u[ldzJ`0qjD7sCkfdMmD*RxpOwEEQ+KWt[{J#x6ow~JO:,zwp.(t; @Aq :4:&nFCgDb8[3oIeTb^'",;u{5{}C9>"PuY\)!=#\u9SSM-nz8+SR~B\!qBv MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200910031800.24896.hselasky@c2i.net> Cc: freebsd-current@freebsd.org Subject: Re: [PATCH] Fix for USB media not found at boot 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: Sat, 03 Oct 2009 15:59:40 -0000 On Saturday 03 October 2009 17:05:35 Scott Long wrote: > On Oct 3, 2009, at 4:30 AM, Hans Petter Selasky wrote: > > On Saturday 03 October 2009 10:19:57 Scott Long wrote: > >> config_intrhook system will sleep after all > > > > Then why do you need the intr hook callback? > > The config_intrhook lets you know that interrupts are enabled, the > scheduler is running, and mountroot hasn't run yet. It provides a > very convenient and standard way to do exactly what we want with USB > enumeration. Hi, The root HUB attach and explore code is already running from a separate thread, so won't that be superfluous? I mean, the HUB explore code for any USB HUB will not run until the scheduler is running anyway. In my opinion delaying the system until the boot disk is present is just not good. We should rather be event driven, so that every time a new disk becomes present it checks it for mountroot. while (1) { if (mountroot is successful) break; if (ctrl+c is pressed) manual_mountroot(); printf("Waiting 1 second for root-disk to appear. Press CTRL+C to abort.\n"); sleep(1); } --HPS