From: Chris Ball <cjb@laptop.org>
To: Stephen Warren <swarren@nvidia.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: Dynamic MMC device naming vs. bootloaders
Date: Mon, 04 Apr 2011 17:29:31 -0400 [thread overview]
Message-ID: <m3ei5haeo4.fsf@pullcord.laptop.org> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF0493EB3428@HQMAIL01.nvidia.com> (Stephen Warren's message of "Mon, 4 Apr 2011 14:07:06 -0700")
Hi Stephen,
On Mon, Apr 04 2011, Stephen Warren wrote:
>> The standard way to solve this is to use an initrd that performs the
>> naming (and mounting) that you'd like based on characteristics of the
>> device or card -- this could include making mmcblk{0,1} always attach
>> to the controllers that you're expecting it to. It's hard enough to get
>> device naming policy right that we don't usually try to do it in-kernel.
>
> I have a followup question: How could the initrd identify each device, in
> order to know which names to assign to them, or which one to mount?
>
> Is there a way to query the block device to determine which host controller
> ID it's connected to? Querying device size is pretty easy, but the user
> could easily happen to choose an SD card of the same size as the internal
> MMC for example.
That's a fine question. I'm not sure what the *best* answer is, but you
have a few options:
* if your initrd contains udev, then the udev event for mmcblk creation
looks like:
UDEV [1292447837.786721] add /devices/platform/sdhci-pxa.0/mmc_host/mmc0/mmc0:d555/block/mmcblk1 (block)
.. which contains the information you need.
* alternatively, you could grovel around sysfs:
[root@localhost ~]# ls -la /sys/block/mmcblk0/device
lrwxrwxrwx 1 root root 0 Jan 1 1970 /sys/block/mmcblk0/device -> ../../../mmc2:0001
So, the above tells you that on my system mmc2 (internal SD slot) hosts
mmcblk0, and mmc0 (external SD slot) hosts mmcblk1.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
next prev parent reply other threads:[~2011-04-04 21:24 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 [this message]
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
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=m3ei5haeo4.fsf@pullcord.laptop.org \
--to=cjb@laptop.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.