Re: [PATCH] mmc: sdhci-esdhc-imx: Allow the usage of mmc aliases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 09/22/2013 08:38 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> 
> On embedded devices, there is often a combination of removable mmc
> devices (e.g. MMC/SD cards) and hard wired ones (e.g. eMMC).
> Depending on the hardware configuration, the 'mmcblkN' node might
> change if the removable device is available or not at boot time.
> 
> E.g. if the removable device is attached at boot time, it might
> become mmxblk0. And the hard wired one mmcblk1. But if the removable
> device isn't there at boot time, the hard wired one will become
> mmcblk0. This makes it somehow difficult to hard code the root device
> to the non-removable device and boot fast.
> 
> Allow the sdhci-esdhc-imx driver to retrieve the mmc aliases, so that we can 
> map via the device tree which mmcblk corresponds to the rootfs.

> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c

> -	devidx = find_first_zero_bit(dev_use, max_devices);
> +	devidx = find_next_zero_bit(dev_use, max_devices, card->host->devidx);

I'm not sure if this works; what if the SD card gets detected/removed
without recycling the device name/ID a few times before the fixed eMMC
is detected?

So, in the perfect case this will achieve what you want, but not in some
unusual cases. So I don't think it's a good idea to rely on this.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux