linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* adding aliases to mmc ... again
@ 2014-05-22 15:30 Sascha Hauer
  2014-05-22 15:30 ` [PATCH 1/2] of: Add helper for getting the maximum alias index for a stem Sascha Hauer
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sascha Hauer @ 2014-05-22 15:30 UTC (permalink / raw)
  To: linux-mmc; +Cc: Dirk Behme, Fabio Estevam, ptx, Stephen Warren

Hi all,

The wish to have persistent MMC block device names for passing a suitable
root=/dev/mmcblkX option came up several times already and has been discussed
at least in these threads:

http://lists.infradead.org/pipermail/linux-arm-kernel/2012-July/109984.html
https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg22104.html
http://comments.gmane.org/gmane.linux.kernel.mmc/21519

Several patches have been proposed to nail the slot index to a known number.
Arguments against these patches were:

- Use an initrd and locate the correct root device there
  even Thomas who suggested this admitted this would be painful to do
- use root=UUID= or root=PARTUUID=
  This generally works but has an important downside. With the UUID
  approach devices which should boot from the internal eMMC may start
  booting from an external SD slot when somebody deliberately inserts
  a SD card with the same UUID.

The following patches should have the technical issues fixed. It works
by counting the mmc aliases in the devicetree during initialization of
the mmc framework. Those slot numbers will never be assigned to other
hosts.

Sascha

----------------------------------------------------------------
Sascha Hauer (2):
      of: Add helper for getting the maximum alias index for a stem
      mmc: Allow setting slot index via devicetree alias

 drivers/mmc/card/block.c | 11 ++++++++++-
 drivers/mmc/core/core.c  | 37 +++++++++++++++++++++++++++++++++++++
 drivers/mmc/core/host.c  | 17 +++++++++++++++--
 drivers/of/base.c        | 29 +++++++++++++++++++++++++++++
 include/linux/mmc/core.h |  3 +++
 include/linux/of.h       |  6 ++++++
 6 files changed, 100 insertions(+), 3 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] mmc: Allow setting slot index via devicetree alias
@ 2014-10-08 10:53 Philippe De Muyter
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe De Muyter @ 2014-10-08 10:53 UTC (permalink / raw)
  To: linux-mmc, Sascha Hauer, Dong Aisheng

Hi Sascha and Dong,

On 2014-05-22 15:30:23, Sascha Hauer wrote:

> If the aliases-node is not found, the driver will act as before.

and the commit (5f9447e5d97060207c4742d5a06e5548de45972d, by Dong Aisheng)
in imx_3.10.31_1.1.0_beta adds :

    The original patch is from here:
    https://www.mail-archive.com/linux-mmc@vger.kernel.org/msg26472.html

    The patch requires additional alias_id fix or it won't work.
    Because according to function definition the max_idx parameter of idx_alloc
    is exclusive, so need add 1 or it will be unable to find the proper idx
    within an invalid range.

I have just upgraded my imx kernel from imx_3.10.17_1.0.0_beta
to imx_3.10.31_1.1.0_beta, but now my new kernel refuses to boot because
it does not find its root fs, because the numbering of the mmc devices
has changed, although I did not add alias id's in my dts file.

Here is what I get :

  Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk0p2 rootwait rw
  ...
  with old method, idx would have been 0
  with new method, idx is 1
  mmcblk1: mmc1:1234 SA04G 3.63 GiB
   mmcblk1: p1 p2
  mmc3: BKOPS_EN bit is not set
  mmc3: new high speed DDR MMC card at address 0001
  with old method, idx would have been 1
  with new method, idx is 3
  mmcblk3: mmc3:0001 MMC04G 3.57 GiB
  mmcblk3boot0: mmc3:0001 MMC04G partition 1 2.00 MiB
  mmcblk3boot1: mmc3:0001 MMC04G partition 2 2.00 MiB
  mmcblk3rpmb: mmc3:0001 MMC04G partition 3 128 KiB
   mmcblk3: unknown partition table
   mmcblk3boot1: unknown partition table
   mmcblk3boot0: unknown partition table
  ...
  Waiting for root device /dev/mmcblk0p2...

Additional debug is mine.

Is there a fix available to preserve the old numbering if no alias has been
defined ?

TIA

Philippe

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-10-08 11:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 15:30 adding aliases to mmc ... again Sascha Hauer
2014-05-22 15:30 ` [PATCH 1/2] of: Add helper for getting the maximum alias index for a stem Sascha Hauer
2014-05-22 15:30 ` [PATCH 2/2] mmc: Allow setting slot index via devicetree alias Sascha Hauer
2014-05-22 16:16 ` adding aliases to mmc ... again Stephen Warren
2014-05-22 18:21   ` Sascha Hauer
2014-05-22 19:23     ` Stephen Warren
2014-05-23  8:29       ` Michael Olbrich
2014-05-23 16:02         ` Stephen Warren
2014-05-23  9:23       ` Sascha Hauer
2014-05-23 16:01         ` Stephen Warren
2014-05-24  5:10           ` Sascha Hauer
  -- strict thread matches above, loose matches on Subject: below --
2014-10-08 10:53 [PATCH 2/2] mmc: Allow setting slot index via devicetree alias Philippe De Muyter

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).