Skip to contentSkip to conversation

arm64: dts: meson: g12b: odroid-n2: Assign a fixed index to mmc devices

PATCH Superseded Alexander Stein 3 participants 13 messages Jan 27, 2021 – Oct 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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

---
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(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +2 -0
index 050862cd0996..2faa4da917c1 100644
@@ -13,6 +13,8 @@ / {
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_b;
+		mmc1 = &sd_emmc_c;
 	};
 
 	dioo2133: audio-amplifier-0 {
Signature · 7 lines
2.30.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#1 lore raw

Hi,

Quoted 5 lines · Alexander Stein

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

Quoted 18 lines

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

---
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(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +0 -0
index 050862cd0996..2faa4da917c1 100644

arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi / { · line 20

Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi +2 -0
@@ -13,6 +13,8 @@ / {
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		mmc0 = &sd_emmc_b;
+		mmc1 = &sd_emmc_c;
 	};
 
 	dioo2133: audio-amplifier-0 {

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#2 lore raw

Hi,

Am Freitag, 29. Januar 2021, 09:07:45 CET schrieb Neil Armstrong:

Quoted 4 lines · Alexander Stein
Quoted 3 lines

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

Quoted 4 lines
Quoted 2 lines

[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

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

maintainer
#3 lore raw
Quoted 12 lines · Alexander Stein

Hi,

Am Freitag, 29. Januar 2021, 09:07:45 CET schrieb Neil Armstrong:

Quoted 4 lines · Alexander Stein
Quoted 3 lines

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

Quoted 4 lines
Quoted 2 lines

[1]
https://patchwork.kernel.org/patch/11747669/

I understand the goal, and this should be done for _all_ boards, not only

Quoted 8 lines

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

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#4 lore raw

PATCH v2 1/1 arm64: dts: amlogic: Assign a fixed index to mmc devices

In reply to Alexander Stein

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

The unconventional order (B, C, A) is due to the fact that sd_emmc_a is (according to the comments) only used for SDIO.

AFAICS all boards either have both sd_emmc_b and sd_emmc_c or only one of them enabled. So the alias order should match the previous non-async order for all of them.

---
Just for the records, I only tested this on my ODROID-N2 (G12 based) board.

 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi         | 6 ++++++
 2 files changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 -0
index 9c90d562ada1..15525f3aa4a6 100644
@@ -17,6 +17,12 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sd_emmc_b;
+		mmc1 = &sd_emmc_c;
+		mmc2 = &sd_emmc_a;
+	};
+
 	chosen {
 		#address-cells = <2>;
 		#size-cells = <2>;
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 -0
index 726b91d3a905..769d7e8fda13 100644
@@ -21,6 +21,12 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sd_emmc_b;
+		mmc1 = &sd_emmc_c;
+		mmc2 = &sd_emmc_a;
+	};
+
 	reserved-memory {
 		#address-cells = <2>;
 		#size-cells = <2>;
Signature · 7 lines
2.30.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
maintainer
#5 lore raw

Re: [PATCH v2 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

Quoted 28 lines · Alexander Stein

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

The unconventional order (B, C, A) is due to the fact that sd_emmc_a is (according to the comments) only used for SDIO.

AFAICS all boards either have both sd_emmc_b and sd_emmc_c or only one of them enabled. So the alias order should match the previous non-async order for all of them.

---
Just for the records, I only tested this on my ODROID-N2 (G12 based) board.

 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi         | 6 ++++++
 2 files changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +0 -0
index 9c90d562ada1..15525f3aa4a6 100644

arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi / { · line 25

Quoted 9 lines
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 -0
@@ -17,6 +17,12 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sd_emmc_b;
+		mmc1 = &sd_emmc_c;
+		mmc2 = &sd_emmc_a;
+	};
+

Thanks for updating this.

minor nit: as I suggested earlier, could you add comments here showing the intention that mmc0 -> SD, mmc1 -> eMMC, mmc2 -> SDIO

Kevin

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#6 lore raw

PATCH v3 1/1 arm64: dts: amlogic: Assign a fixed index to mmc devices

In reply to Alexander Stein

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

The unconventional order (B, C, A) is due to the fact that sd_emmc_a is (according to the comments) only used for SDIO.

AFAICS all boards either have both sd_emmc_b and sd_emmc_c or only one of them enabled. So the alias order should match the previous non-async order for all of them.

---
Changes in v3:
* Added comment on intented ordering

 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 6 ++++++
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi         | 6 ++++++
 2 files changed, 12 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +6 -0
index 9c90d562ada1..f9a42f45ac52 100644
@@ -17,6 +17,12 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sd_emmc_b; /* SD card */
+		mmc1 = &sd_emmc_c; /* eMMC */
+		mmc2 = &sd_emmc_a; /* SDIO */
+	};
+
 	chosen {
 		#address-cells = <2>;
 		#size-cells = <2>;
arch/arm64/boot/dts/amlogic/meson-gx.dtsi +6 -0
index 726b91d3a905..59d11f65c7b3 100644
@@ -21,6 +21,12 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
+	aliases {
+		mmc0 = &sd_emmc_b; /* SD card */
+		mmc1 = &sd_emmc_c; /* eMMC */
+		mmc2 = &sd_emmc_a; /* SDIO */
+	};
+
 	reserved-memory {
 		#address-cells = <2>;
 		#size-cells = <2>;
Signature · 7 lines
2.30.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#7 lore raw

Re: [PATCH v3 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

Am Mittwoch, 3. Februar 2021, 20:28:24 CET schrieb Alexander Stein:

Quoted 9 lines

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

Quoted 8 lines

The unconventional order (B, C, A) is due to the fact that sd_emmc_a is (according to the comments) only used for SDIO.

AFAICS all boards either have both sd_emmc_b and sd_emmc_c or only one of them enabled. So the alias order should match the previous non-async order for all of them.

Any feedback on this?

Best regards,
Alexander

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

maintainer
#8 lore raw

Re: [PATCH v3 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

Quoted 13 lines · Alexander Stein

Am Mittwoch, 3. Februar 2021, 20:28:24 CET schrieb Alexander Stein:

Quoted 12 lines

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

The unconventional order (B, C, A) is due to the fact that sd_emmc_a is (according to the comments) only used for SDIO.

Quoted 7 lines
Quoted 5 lines

AFAICS all boards either have both sd_emmc_b and sd_emmc_c or only one of them enabled. So the alias order should match the previous non-async order for all of them.

Any feedback on this?

Sorry for the delay.

I somehow missed this v3 at the end of the v5.12 cycle, but I've queued it up for v5.13 now so it should get broader testing in linux-next now.

Kevin

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#9 lore raw

Re: [PATCH v3 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

Hello Kevin,

Am Montag, 8. März 2021, 18:43:35 CEST schrieb Kevin Hilman:

Quoted 5 lines

[...]
Sorry for the delay.

I somehow missed this v3 at the end of the v5.12 cycle, but I've queued it up for v5.13 now so it should get broader testing in linux-next now.

Was this patch [1] missed again by mistake? I can't find it in linux-next or anywhere else. [2] also shows that this commit is not referenced from any branch.

Best regards,
Alexander

[1] https://patchwork.kernel.org/project/linux-amlogic/patch/
[email protected]/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git/commit/?
id=7827db7f6141fda9af4b07864cab0c10398affff

#10 lore raw

Re: [PATCH v3 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

Hi Alexander,

Le 02/10/2021 à 08:56, Alexander Stein a écrit :

Quoted 6 lines

Hello Kevin,

Am Montag, 8. März 2021, 18:43:35 CEST schrieb Kevin Hilman:

Quoted 3 lines

[...]
Sorry for the delay.

Quoted 6 lines
Quoted 2 lines

I somehow missed this v3 at the end of the v5.12 cycle, but I've queued it up for v5.13 now so it should get broader testing in linux-next now.

Was this patch [1] missed again by mistake? I can't find it in linux-next or anywhere else. [2] also shows that this commit is not referenced from any branch.

Look at https://github.com/torvalds/linux/blame/53d5fc89d66a778577295020dc57bb3ccec84354/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi#L21

The commit https://github.com/torvalds/linux/commit/ab547c4fb39fe145b39e3013633258a5ff475d88 is upstream since v5.13-rc1

Neil

Quoted 10 lines

Best regards,
Alexander

[1] https://patchwork.kernel.org/project/linux-amlogic/patch/
[email protected]/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git/commit/?
id=7827db7f6141fda9af4b07864cab0c10398affff

#11 lore raw

Re: [PATCH v3 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

Hello Neil,

Am Samstag, 2. Oktober 2021, 10:49:46 CEST schrieb Neil Armstrong:

Quoted 7 lines

Look at
https://github.com/torvalds/linux/blame/53d5fc89d66a778577295020dc57bb3ccec
84354/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi#L21

The commit
https://github.com/torvalds/linux/commit/ab547c4fb39fe145b39e3013633258a5ff
475d88 is upstream since v5.13-rc1

Ah, the SHA1 changed. Dunno why I didn't see it in mainline though. Thanks for the update and sorry for the noise.

Best regards,
Alexander

maintainer Applied
#12 lore raw

Re: [PATCH v3 1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

In reply to Alexander Stein
Quoted 9 lines · Alexander Stein

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

[...]

Applied, thanks!

[1/1] arm64: dts: amlogic: Assign a fixed index to mmc devices

      commit: 7827db7f6141fda9af4b07864cab0c10398affff

Best regards,

Signature · 6 lines
Kevin Hilman <[email protected]>

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic