public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus@drzeus.cx>
To: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MMC: Flush mmc workqueue late in the boot sequence
Date: Thu, 10 May 2007 21:41:22 +0200	[thread overview]
Message-ID: <46437562.9050501@drzeus.cx> (raw)
In-Reply-To: <20070510182749.219351cb@dhcp-252-105.norway.atmel.com>

[-- Attachment #1: Type: text/plain, Size: 3549 bytes --]

Haavard Skinnemoen wrote:
> On Thu, 10 May 2007 17:58:27 +0200
> Pierre Ossman <drzeus@drzeus.cx> wrote:
> 
> Is there any way this can happen? Host controller drivers register
> themselves from module_init(), their probe() function gets called,
> which calls mmc_add_host(), which schedules the initial scan. If
> multiple host controllers are present, they will all schedule their
> scans before all module_init()s have been called. Am I missing
> something?
> 

You're assuming two things:

1. The bus the host controller reside on is synchronous both in adding devices
and drivers. This is true for most buses, but not all. As we can see, the MMC
bus is an example of one that isn't.

2. The bus the host controller reside on is scanned before any sync function we add.

The second probably isn't much of a stretch, but the first is more likely to
break. E.g. an usb based controller would not satisfy 1 as usb is scanned
asynchronously. Platform devices are case by case (e.g. some device might be
delayed since it needs time to power up).

>> Indeed. But it is not by design that they are scheduled before late_initcall().
>> Also, flushing the workqueue is also not a by-design way of completing a scan,
>> it just happens to be that way right now.
> 
> So how is it supposed to work "by design"?
> 

It isn't. The MMC bus is a pesky bugger in that it is slow and involves a lot of
sleeping and asynchronous callbacks. As such, synchronisation needs to be very
explicit using for example completions.

>>> And I never realized that using a block device as a parameter to the
>>> root= parameter could possibly be "unofficial" functionality...?
>> Then you've learned something new. ;)
> 
> Guess so. It seems like the prepare_namespace stuff is getting less
> useful every day.
> 

Probably. But I'd like to hope we're gaining more than we lose. There are some
horror stories from the scsi camp where synchronous scanning means it takes an
hour to boot a machine.

>> Only some devices work that way (generally only those with "simple" interfaces).
>> And most things are these days behind more advanced buses, more akin to a network.
> 
> It's funny that NFS root does not have these kinds of problems then...
> 

I'm not familiar with that code, but I would guess it has a whole bunch of
prerequisite conditions. And the nfs root installations I've seen all use
initrd, so I would assume there are some restrictions to letting the kernel
handle it.

>> Generally, not waiting for a lot of hardware is a good thing as it speeds up
>> boot times. In my mind, the proper way is having a script in an initrd that
>> waits for just the parts of the hardware that this particular system needs.
>> Everything else can be brought up in the background.
> 
> Yeah, but I suspect most users will rather have a system that actually
> boots than a system that would have booted very quickly if it had booted
> at all.
> 

I think most people can live with having an initrd, so I wouldn't paint quite
such a bleak picture.

> Btw, how can I wait for the scanning to complete from early userspace?
> 

Monitor /proc/partitions or /sys until the device you need for rootfs shows up.


The big problem from my point of view is that I do not want to start promising
people a feature we might not be able to support in the future, and perhaps not
even now with some hardware.

Is there some reason you cannot use an initrd or is it just the inconvenience?


Rgds
Pierre


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

  parent reply	other threads:[~2007-05-10 19:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 10:35 [PATCH] MMC: Flush mmc workqueue late in the boot sequence Haavard Skinnemoen
2007-05-10 12:04 ` Pierre Ossman
2007-05-10 12:37   ` Haavard Skinnemoen
2007-05-10 13:45     ` Pierre Ossman
2007-05-10 14:33       ` Haavard Skinnemoen
2007-05-10 15:58         ` Pierre Ossman
2007-05-10 16:27           ` Haavard Skinnemoen
2007-05-10 17:51             ` Matt Reimer
2007-05-11  7:44               ` Haavard Skinnemoen
2007-05-10 19:41             ` Pierre Ossman [this message]
2007-05-11  8:39               ` Haavard Skinnemoen
2007-05-13 13:34                 ` Pierre Ossman
2007-05-13 13:47                   ` Haavard Skinnemoen
2007-05-13 14:24                     ` Pierre Ossman
2007-05-13 14:37                       ` Haavard Skinnemoen

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=46437562.9050501@drzeus.cx \
    --to=drzeus@drzeus.cx \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    /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