From owner-freebsd-usb@FreeBSD.ORG Tue Feb 17 02:03:31 2009 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB4410656F5 for ; Tue, 17 Feb 2009 02:03:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 516FA8FC0A for ; Tue, 17 Feb 2009 02:03:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n1H2369x013587; Mon, 16 Feb 2009 19:03:06 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 16 Feb 2009 19:03:12 -0700 (MST) Message-Id: <20090216.190312.1756925299.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: <6E9B5FF6-685B-427C-87A7-C95850DA5B6F@mac.com> References: <741FAA3B-B91A-4A23-B47F-21141A8D0B5D@mac.com> <20090216.173544.1555327603.imp@bsdimp.com> <6E9B5FF6-685B-427C-87A7-C95850DA5B6F@mac.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: usb@freebsd.org Subject: Re: USB2+umass: root mount fails X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2009 02:03:32 -0000 In message: <6E9B5FF6-685B-427C-87A7-C95850DA5B6F@mac.com> Marcel Moolenaar writes: : : On Feb 16, 2009, at 4:35 PM, M. Warner Losh wrote: : : > In message: <741FAA3B-B91A-4A23-B47F-21141A8D0B5D@mac.com> : > Marcel Moolenaar writes: : > : : > : On Feb 16, 2009, at 3:13 PM, M. Warner Losh wrote: : > : : > : > In message: : > : > Marcel Moolenaar writes: : > : > : Before I dig into the code, what's the current status of : > : > : root mounts on USB mass storage devices? : > : > : > : > First, there's a kludge-o-round that is similar to your "sleep 10" : > : > that you've added. It loops waiting for more devices to show up : > if : > : > the desired root file system hasn't appeared yet. : > : > : > : > There's no way for hot-plug busses to tell the kernel "I've : > tried my : > : > best to enumerate everything on my bus, and I'm done" : > : : > : Of course there is. Any and all USB hubs have a certain : > : number of ports. You can trivially iterate over all of : > : them and declare completion when you've tried them all. : > : > The hot-plug busses know. The mountroot code doesn't have a way to : > wait for the hot-plug busses. : : Huh? : root_mount_hold() and root_mount_rel() are specifically : designed to inform the mountroot code that it needs to : wait (or that it should go ahead and mount root). r145250 | phk | 2005-04-18 15:21:26 -0600 (Mon, 18 Apr 2005) | 12 lines Add a named reference-count KPI to hold off mounting of the root filesystem. While we wait for holds to be released, print a list of who holds us back once per second. Use the new KPI from GEOM instead of vfs_mount.c calling g_waitidle(). Use the new KPI also from ata. With ATAmkIII's newbusification, ata could narrowly miss the window and ad0 would not exist when we tried to mount root. ---- But it looks like the old usb code didn't call it either... I think old code enumerated right away during boot, while the new code defers the enumeration until events can be processed... Warner