mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ming Lei <tom.leiming@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Arjan van de Ven <arjan@infradead.org>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	David VomLehn <dvomlehn@cisco.com>,
	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
Date: Tue, 5 May 2009 23:53:38 +0800	[thread overview]
Message-ID: <d82e647a0905050853q4a1d5066ib71411cbef186c45@mail.gmail.com> (raw)
In-Reply-To: <20090505234725.5ab247db@linux-lm>

2009/5/5 Ming Lei <tom.leiming@gmail.com>:
> On Mon, 4 May 2009 11:07:52 -0400 (EDT)
> Alan Stern <stern@rowland.harvard.edu> wrote:
>
>> On Mon, 4 May 2009, Arjan van de Ven wrote:
>>
>> > > > for normal device probing we already have infrastructure
>> > > > though... wait_for_device_probe, driver_probe_done and
>> > > > friends... (the scsi scanning thread is being converted to the
>> > > > async infrastructure btw)
>> > > >
>> > > > do we need to invent more ?
>> > >
>> > > I suppose the usb-storage scanning thread could also be converted
>> > > to the async infrastructure, although I haven't heard of anybody
>> > > working on it.
>> > >
>> > > But the USB hub driver's thread (khubd) cannot be converted.  It
>> > > is central to the discovery of USB-based block devices.  How
>> > > would you handle that?
>> >
>> > take a ref in the driver_probe_done() sense, and release it when you
>> > know you're done probing....
>> >
>> > at that point all existing infrastructure will just work.
>>
>> 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?

Also need all block device drivers use initdev_*, much work to do,:-)

>
> 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();
>        }
>
>
>
>
> --
> Lei Ming
>



-- 
Lei Ming

  reply	other threads:[~2009-05-05 15:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-02  2:25 David VomLehn
2009-05-02 13:31 ` Sergey Vlasov
2009-05-02 14:16   ` Alan Stern
2009-05-05  0:33     ` David VomLehn
2009-05-05  0:31   ` [PATCH 1/5] initdev:kernel: Asynchronously-discovered devicesynchronization, v5 David VomLehn
2009-05-02 14:01 ` [PATCH 1/5] initdev:kernel: Asynchronously-discovered device synchronization, v5 James Bottomley
2009-05-02 17:55   ` Alan Stern
2009-05-03 23:21     ` Arjan van de Ven
2009-05-04 14:30       ` Alan Stern
2009-05-04 14:45         ` Arjan van de Ven
2009-05-04 15:07           ` Alan Stern
2009-05-05 15:47             ` Ming Lei
2009-05-05 15:53               ` Ming Lei [this message]
2009-06-05 18:00                 ` David VomLehn
2009-06-05 17:58               ` David VomLehn
2009-05-05  0:55     ` David VomLehn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d82e647a0905050853q4a1d5066ib71411cbef186c45@mail.gmail.com \
    --to=tom.leiming@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=dvomlehn@cisco.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®