diff mbox series

[1/1] arm64: dts: meson: g12b: odroid-n2: Assign a fixed index to mmc devices

Message ID 20210127230852.66686-1-alexander.stein@mailbox.org (mailing list archive)
State New, archived
Headers show
Series [1/1] arm64: dts: meson: g12b: odroid-n2: Assign a fixed index to mmc devices | expand

Commit Message

Alexander Stein Jan. 27, 2021, 11:08 p.m. UTC
Recently introduced async probe on mmc devices can shuffle block IDs.
Pin them to fixed values to ease booting in environments where UUIDs
are not practical. Use newly introduced aliases for mmcblk devices from [1].
[1]
https://patchwork.kernel.org/patch/11747669/

Commit message taken from commit 0011c6d18277 ("arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.")

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
I was wondering which order I should use. Depending in your booting
medium (SD card or eMMC) you 'want' one or the other as mmc0.
In the end I ordered them according to the names.

 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 ++
 1 file changed, 2 insertions(+)

Comments

Neil Armstrong Jan. 29, 2021, 8:07 a.m. UTC | #1
Hi,

On 28/01/2021 00:08, Alexander Stein wrote:
> Recently introduced async probe on mmc devices can shuffle block IDs.
> Pin them to fixed values to ease booting in environments where UUIDs
> are not practical. Use newly introduced aliases for mmcblk devices from [1].
> [1]
> https://patchwork.kernel.org/patch/11747669/

I understand the goal, and this should be done for _all_ boards, not only the Odroid-N2.

Neil

> 
> Commit message taken from commit 0011c6d18277 ("arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.")
> 
> Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
> ---
> I was wondering which order I should use. Depending in your booting
> medium (SD card or eMMC) you 'want' one or the other as mmc0.
> In the end I ordered them according to the names.
> 
>  arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> index 050862cd0996..2faa4da917c1 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> @@ -13,6 +13,8 @@ / {
>  	aliases {
>  		serial0 = &uart_AO;
>  		ethernet0 = &ethmac;
> +		mmc0 = &sd_emmc_b;
> +		mmc1 = &sd_emmc_c;
>  	};
>  
>  	dioo2133: audio-amplifier-0 {
>
Alexander Stein Jan. 29, 2021, 8:51 p.m. UTC | #2
Hi,

Am Freitag, 29. Januar 2021, 09:07:45 CET schrieb Neil Armstrong:
> On 28/01/2021 00:08, Alexander Stein wrote:
> > Recently introduced async probe on mmc devices can shuffle block IDs.
> > Pin them to fixed values to ease booting in environments where UUIDs
> > are not practical. Use newly introduced aliases for mmcblk devices from 
[1].
> > [1]
> > https://patchwork.kernel.org/patch/11747669/
> 
> I understand the goal, and this should be done for _all_ boards, not only 
the Odroid-N2.

I see. So there are 2 options:
1.
Set the mapping for all 3 sd_emmc_* in the top-most .dtsi
Upside: very easy patch
Downside: When sd_emmc_a is not enabled "mmc0" will never be available.
Might be confusing.

2.
Set mapping only for enabled sd_emmc_* in the .dts[i] where it is enabled
Upside: Clean setup, only enabled sd_emmc_* have an alias
Downside: Much verbose patch(set)

Any preferences here? I honestly tend to 1. But this might break boards where
sd_emmc_a is not enabled, because the root device _will_ change in that case.

Best regards,
Alexander
Kevin Hilman Feb. 2, 2021, 12:50 a.m. UTC | #3
Alexander Stein <alexander.stein@mailbox.org> writes:

> Hi,
>
> Am Freitag, 29. Januar 2021, 09:07:45 CET schrieb Neil Armstrong:
>> On 28/01/2021 00:08, Alexander Stein wrote:
>> > Recently introduced async probe on mmc devices can shuffle block IDs.
>> > Pin them to fixed values to ease booting in environments where UUIDs
>> > are not practical. Use newly introduced aliases for mmcblk devices from 
> [1].
>> > [1]
>> > https://patchwork.kernel.org/patch/11747669/
>> 
>> I understand the goal, and this should be done for _all_ boards, not only 
> the Odroid-N2.
>
> I see. So there are 2 options:
> 1.
> Set the mapping for all 3 sd_emmc_* in the top-most .dtsi
> Upside: very easy patch
> Downside: When sd_emmc_a is not enabled "mmc0" will never be available.
> Might be confusing.

sd_emmc_a is (almost?) always the iface used for SDIO devices, which are
not always present.

I would recommend we go with a single mapping in the top-level .dtsi

  SD card -> mmc0  (sd_emmc_b)
  eMMC    -> mmc1  (sd_emmc_c)
  SDIO    -> mmc2  (sd_emmc_a)

it's not exactly obvious why we don't go 0,1,2 == A,B,C but just
document it in the top-level .dtsi.

This approach also has the benefit of having the devices show up how
many/most boards showed up before the async probe changes.

Kevin
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 050862cd0996..2faa4da917c1 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -13,6 +13,8 @@  / {
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_b;
+		mmc1 = &sd_emmc_c;
 	};
 
 	dioo2133: audio-amplifier-0 {