Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756292AbZFER61 (ORCPT ); Fri, 5 Jun 2009 13:58:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755299AbZFER6P (ORCPT ); Fri, 5 Jun 2009 13:58:15 -0400 Received: from sj-iport-1.cisco.com ([171.71.176.70]:48234 "EHLO sj-iport-1.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752813AbZFER6N (ORCPT ); Fri, 5 Jun 2009 13:58:13 -0400 X-IronPort-AV: E=Sophos;i="4.41,312,1241395200"; d="scan'208";a="195539132" Date: Fri, 5 Jun 2009 10:58:16 -0700 From: David VomLehn To: Ming Lei Cc: Alan Stern , Arjan van de Ven , James Bottomley , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-usb@vger.kernel.org, greg@kroah.com, linux-scsi@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 1/5] initdev:kernel: Asynchronously-discovered device synchronization, v5 Message-ID: <20090605175816.GB18688@cuplxvomd02.corp.sa.net> References: <20090505234725.5ab247db@linux-lm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090505234725.5ab247db@linux-lm> User-Agent: Mutt/1.5.18 (2008-05-17) Authentication-Results: sj-dkim-3; header.From=dvomlehn@cisco.com; dkim=pass ( sig from cisco.com/sjdkim3002 verified; ); Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2033 Lines: 63 On Tue, May 05, 2009 at 11:47:25AM -0400, Ming Lei wrote: > On Mon, 4 May 2009 11:07:52 -0400 (EDT) > Alan Stern wrote: > > > On Mon, 4 May 2009, Arjan van de Ven wrote: ... > > Isn't there still something missing? The wait_for_device_probe() > > routine would wait until all attached devices had been probed. But > > why should prepare_namespace() have to wait that long? Wouldn't it be > > better to wait only until the root device has been registered? > > Yes, maybe David should merge the following patch into the patch > No.5(initdev:kernel: USB and SCSI block init device notification, v3). > > Right? > > diff --git a/init/do_mounts.c b/init/do_mounts.c > index dd7ee5f..22fd773 100644 > --- a/init/do_mounts.c > +++ b/init/do_mounts.c > @@ -358,6 +358,12 @@ void __init mount_root(void) > #endif > } > > +static int root_dev_done() > +{ > + return !!(ROOT_DEV = name_to_dev_t(saved_root_name)); > +} > + > + > /* > * Prepare the namespace - decide what/where to mount, load ramdisks, > etc. */ > @@ -398,12 +404,12 @@ void __init prepare_namespace(void) > goto out; > > /* wait for any asynchronous scanning to complete */ > - if ((ROOT_DEV == 0) && root_wait) { > + if (ROOT_DEV == 0 && root_wait) { > printk(KERN_INFO "Waiting for root device %s...\n", > saved_root_name); > - while (driver_probe_done() != 0 || > - (ROOT_DEV = name_to_dev_t(saved_root_name)) == > 0) > - msleep(100); > + do { > + initdev_wait(BOOTDEV_BLOCK, root_dev_done); > + } while (!ROOT_DEV); > async_synchronize_full(); > } I have something very similar. I'm not completely comfortable with discarding the rootwait flag, though it should be very rarely used once the initdev infrastructure is in place. > Lei Ming David VomLehn -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/