[PATCH 0/2] sunxi: Enforce consistent MMC numbering

Maxime Ripard maxime at cerno.tech
Fri Apr 30 10:10:35 BST 2021


On Mon, Apr 19, 2021 at 09:54:43AM +0100, Andre Przywara wrote:
> On Mon, 19 Apr 2021 11:17:19 +0800
> Chen-Yu Tsai <wens at csie.org> wrote:
> 
> Hi,
> 
> > On Mon, Apr 19, 2021 at 10:52 AM Samuel Holland <samuel at sholland.org> wrote:
> > >
> > > Dealing with the inconsistent numbering has been a major pain, and
> > > there is a solution with (as far as I can tell) no tangible downsides.
> > > So let's use it.
> 
> Thanks Samuel for sending this!
> 
> > > Yes, I know the kernel supports UUIDs for root=. But UUIDs do not help
> > > when referencing the whole, unpartitioned device, like is needed for
> > > updating the bootloader and firmware. So for the use case of "write a
> > > bootloader to the SD card, regardless of where the board is currently
> > > booted from", I know of two options:
> > >   - Dig around in sysfs to find the mmc number from the MMIO address,
> > >     which means I have to know the MMIO addresses for every SoC, or
> > >   - Apply patches like these.
> > >
> > > Samuel Holland (2):
> > >   ARM: dts: sunxi: h3/h5: Enforce consistent MMC numbering
> > >   arm64: dts: allwinner: Enforce consistent MMC numbering
> > >
> > >  arch/arm/boot/dts/sunxi-h3-h5.dtsi            | 6 ++++++
> > >  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 ++++++
> > >  arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  | 6 ++++++  
> > 
> > At least with Rockchip this is now done at the board level. IIRC it was
> > a request from other people to not do it at the SoC level. I don't recall
> > exactly who though.
> 
> FWIW, I am very much in favour of these patches, at a SoC level:
> The *SoC* BootROM imposes an order, by probing the first (by MMIO
> address order) MMC controller first for boot devices. IIRC that's a
> different story for Rockchip?
> And if people really don't care about the order, then having a certain
> order doesn't hurt, so we could as well use the "natural" order, as it
> was before.

This doesn't have anything to do with the BootRom though but what we
provide to the userspace? The userspace has no guarantee about the
kernel enumeration order for any bus (but UART for some reason), I'm not
really sure why MMC would be an exception. Especially since the kernel
will not try to catch up, this will be bound to be broken on a regular
basis.

And that aside, assuming that a device only has an eMMC this would
create the mmc2 device, which is completely weird and inconsistent with
how any other bus behaves.

> Also UUIDs only help if you boot with an initramfs to resolve them,
> which proves to be extra pain if you don't compile kernels on the
> device, or not inside a distribution environment.

I'm not sure what you mean? The kernel is perfectly able to resolve
them. You can also use PARTLABEL if you want something more user
friendly.

Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210430/11d6b4ae/attachment.sig>


More information about the linux-arm-kernel mailing list