From: Andrei Warkentin <andreiw@motorola.com>
To: Stephen Warren <swarren@nvidia.com>
Cc: Kishore Kadiyala <kishorek.kadiyala@gmail.com>,
"cjb@laptop.org" <cjb@laptop.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: Dynamic MMC device naming vs. bootloaders
Date: Wed, 6 Apr 2011 12:40:38 -0500 [thread overview]
Message-ID: <BANLkTimZtSsHE3VkxwCAH1SnNuhEz46oSg@mail.gmail.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF0493EB36DB@HQMAIL01.nvidia.com>
On Wed, Apr 6, 2011 at 12:32 PM, Stephen Warren <swarren@nvidia.com> wrote:
> Andrei Warkentin wrote at Wednesday, April 06, 2011 11:19 AM:
>> On Wed, Apr 6, 2011 at 11:59 AM, Stephen Warren <swarren@nvidia.com> wrote:
>> > However, isn't it just a fluke that this will work; registering the internal
>> > host controller first will I assume start probing of any attached devices on
>> > that controller first, but does it actually guarantee that such probing will
>> > also complete first, which I believe is the necessary condition for the mmcblk
>> > device to be assigned ID 0?
>> >
>>
>> The device index is only assigned if the mmc block driver is started
>> on a detected card. ...
>>
>> > Equally, if there were two controllers with fixed/internal MMC and/or two
>> > controllers which supported pluggable SD cards, the race issue would still
>> > exist?
>>
>> I think if you had two controllers and you plugged two cards in at the
>> "same time", then you would have a race condition, as both would
>> mmc_detect_change (effectively schedule_work to an ordered wq), and it
>> would depend on which card change IRQ occured first. It seems like
>> different hosts use different delays for when the work will be done,
>> so if you have different hosts, you can make this even more obvious.
>> You'd have to really try, though, I think. I guess if you are never
>> going to support multiple cards on one host, you might as well tie the
>> block index to host index.
>
> The case I care about most right now is a cold kernel boot. This is
> basically the same as plugging two SD cards in at (exactly) the same time;
> the time being when the SD platform driver is registered. The fact that
> that on my board, one is actually eMMC and one really an SD card that's
> already plugged in pre-boot isn't really that relevant.
>
> So, if I interpret your statements correctly, you're agreeing that simply
> registering the host controller for eMMC first doesn't guarantee that
> the eMMC will be block device ID 0, albeit in practice that does seem to
> be true a large enough percentage of the time not to notice any problem.
>
The call path is:
mmc_add_host
mmc_start_host
mmc_detect_change schedules mmc_rescan work with no delay
So two consecutive mmc_add_host-s for two different hosts implies that
the first mmc_rescan will happen for the first added host. So the
answer to your question is no - you seem to have that guarantee.
A
prev parent reply other threads:[~2011-04-06 17:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 17:39 Dynamic MMC device naming vs. bootloaders Stephen Warren
2011-04-04 17:58 ` Chris Ball
2011-04-04 21:07 ` Stephen Warren
2011-04-04 21:29 ` Chris Ball
2011-04-05 6:37 ` Kishore Kadiyala
2011-04-05 21:28 ` Stephen Warren
2011-04-06 10:11 ` Kishore Kadiyala
2011-04-06 16:59 ` Stephen Warren
2011-04-06 17:18 ` Andrei Warkentin
2011-04-06 17:32 ` Stephen Warren
2011-04-06 17:40 ` Andrei Warkentin [this message]
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=BANLkTimZtSsHE3VkxwCAH1SnNuhEz46oSg@mail.gmail.com \
--to=andreiw@motorola.com \
--cc=cjb@laptop.org \
--cc=kishorek.kadiyala@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=swarren@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).