Skip to contentSkip to conversation

arm64: dts: renesas: r8a77990: ebisu: Fix backlight regulator numbering

PATCH In review [email protected] 4 participants 9 messages Jan 9, 2019 – Jul 31, 2019

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

PATCH 1/1 arm64: dts: renesas: r8a77990: ebisu: Fix backlight regulator numbering

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add backlight")
---
 arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
index e0590c0af4c4..89383aa35d65 100644
@@ -191,7 +191,7 @@
 		clock-frequency = <24576000>;
 	};
 
-	reg_12p0v: regulator1 {
+	reg_12p0v: regulator2 {
 		compatible = "regulator-fixed";
 		regulator-name = "D12.0V";
 		regulator-min-microvolt = <12000000>;
Signature · 1 line
2.19.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 7 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add backlight")

arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts line 197

Quoted 11 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
@@ -191,7 +191,7 @@
                clock-frequency = <24576000>;
        };
 
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 24 lines · Geert Uytterhoeven
Quoted 7 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 7 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add backlight")
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +0 -0
@@ -191,7 +191,7 @@
                clock-frequency = <24576000>;
        };
 
Quoted 9 lines

arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts line 197

Quoted 5 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

I think I would prefer that addressed in a follow-up patch.

Tested-by
#3 lore raw
Quoted 35 lines · Simon Horman
Quoted 24 lines · Geert Uytterhoeven
Quoted 7 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 7 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add backlight")
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +0 -0
@@ -191,7 +191,7 @@
                clock-frequency = <24576000>;
        };
 
Quoted 9 lines

arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts line 197

Quoted 5 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

Quoted 1 line

I think I would prefer that addressed in a follow-up patch.

Thanks for this patch.

I have now tested it and it looks good to me.
I can now access eMMC as a block device.

I plan to apply this for v5.1 as the problem appears to be introduced in a patch queued-up for v5.1.

# dmesg | egrep "(ee160000.sd|mmc0|mmcblk0|backlight)"
[    0.893760] pwm-backlight backlight: Linked as a consumer to regulator.3
[    2.901953] renesas_sdhi_internal_dmac ee160000.sd: Linked as a consumer to regulator.2
[    2.910262] renesas_sdhi_internal_dmac ee160000.sd: Linked as a consumer to regulator.1
[    2.967591] renesas_sdhi_internal_dmac ee160000.sd: mmc0 base at 0xee160000 max clock rate 200 MHz
[    3.049943] mmc0: new HS200 MMC card at address 0001
[    3.055843] mmcblk0: mmc0:0001 BGSD3R 29.1 GiB 
[    3.064414] mmcblk0boot0: mmc0:0001 BGSD3R partition 1 16.0 MiB
[    3.074888] mmcblk0boot1: mmc0:0001 BGSD3R partition 2 16.0 MiB
[    3.081522] mmcblk0rpmb: mmc0:0001 BGSD3R partition 3 4.00 MiB, chardev (243:0)
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.7343 s, 36.4 MB/s
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 8.46809 s, 63.4 MB/s
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.6945 s, 36.5 MB/s
# dd of=/dev/mmcblk0 if=/dev/zero bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 19.1677 s, 28.0 MB/s
# dd of=/dev/mmcblk0 if=/dev/zero bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 21.3139 s, 25.2 MB/s
# dd of=/dev/mmcblk0 if=/dev/zero bs=1M count=512 oflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 19.9205 s, 27.0 MB/s
#4 lore raw
Quoted 40 lines · Simon Horman
Quoted 35 lines · Simon Horman
Quoted 24 lines · Geert Uytterhoeven
Quoted 7 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 7 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add backlight")
Quoted 6 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +0 -0
@@ -191,7 +191,7 @@
                clock-frequency = <24576000>;
        };
 
Quoted 9 lines

arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts line 197

Quoted 5 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

Quoted 1 line

I think I would prefer that addressed in a follow-up patch.

Thanks for this patch.

Quoted 7 lines

I have now tested it and it looks good to me.
I can now access eMMC as a block device.

I plan to apply this for v5.1 as the problem appears to be introduced in a patch queued-up for v5.1.

Thanks

Quoted 11 lines
# dmesg | egrep "(ee160000.sd|mmc0|mmcblk0|backlight)"
[    0.893760] pwm-backlight backlight: Linked as a consumer to regulator.3
[    2.901953] renesas_sdhi_internal_dmac ee160000.sd: Linked as a consumer to regulator.2
[    2.910262] renesas_sdhi_internal_dmac ee160000.sd: Linked as a consumer to regulator.1
[    2.967591] renesas_sdhi_internal_dmac ee160000.sd: mmc0 base at 0xee160000 max clock rate 200 MHz
[    3.049943] mmc0: new HS200 MMC card at address 0001
[    3.055843] mmcblk0: mmc0:0001 BGSD3R 29.1 GiB 
[    3.064414] mmcblk0boot0: mmc0:0001 BGSD3R partition 1 16.0 MiB
[    3.074888] mmcblk0boot1: mmc0:0001 BGSD3R partition 2 16.0 MiB
[    3.081522] mmcblk0rpmb: mmc0:0001 BGSD3R partition 3 4.00 MiB, chardev (243:0)
Quoted 12 lines
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.7343 s, 36.4 MB/s
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 8.46809 s, 63.4 MB/s
# dd if=/dev/mmcblk0 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.6945 s, 36.5 MB/s

Seems a bit slow to me for an HS200 card :-)
Update your ATF, it has QoS updates for SDHI.

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw
In reply to Simon Horman
Quoted 41 lines · On Wednesday, 9 January 2019 18:58:23 EET Simon Horman wrote:
Quoted 32 lines · Geert Uytterhoeven
Quoted 9 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten
by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 8 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add

backlight")

Quoted 11 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
@@ -191,7 +191,7 @@
 
                clock-frequency = <24576000>;
 
        };
 
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
 
Quoted 7 lines
Quoted 3 lines
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

Quoted 1 line

I think I would prefer that addressed in a follow-up patch.

Agreed, but it would still be a very good idea. I think we need to standardize names for regulators, otherwise this is bound to happen again in the future.

Signature · 3 lines
Regards,

Laurent Pinchart
#6 lore raw
Quoted 42 lines · Laurent Pinchart
Quoted 41 lines · On Wednesday, 9 January 2019 18:58:23 EET Simon Horman wrote:
Quoted 39 lines · Geert Uytterhoeven
Quoted 9 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten
by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 8 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add

backlight")

Quoted 11 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
@@ -191,7 +191,7 @@
 
                clock-frequency = <24576000>;
 
        };
 
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
 
Quoted 3 lines
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

Quoted 4 lines
Quoted 1 line

I think I would prefer that addressed in a follow-up patch.

Agreed, but it would still be a very good idea. I think we need to standardize names for regulators, otherwise this is bound to happen again in the future.

Isn't the YAML DT schema validator supposed to catch those problems ? I'd even expect DTC to be able to catch such duplicate nodes and warn about them.

Signature · 2 lines
Best regards,
Marek Vasut
#7 lore raw

DTC check_duplicate_node_names (was: Re: [PATCH] arm64: dts: renesas: r8a77990: ebisu: Fix backlight regulator numbering)

Hi Marek,

Bringing this to the attention of the DTC people...

Quoted 43 lines · Marek Vasut
Quoted 42 lines · Laurent Pinchart
Quoted 41 lines · On Wednesday, 9 January 2019 18:58:23 EET Simon Horman wrote:
Quoted 39 lines · Geert Uytterhoeven
Quoted 9 lines · On Wed, Jan 9, 2019 at 3:01 PM <[email protected]> wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten
by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 8 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add

backlight")

Quoted 11 lines
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
@@ -191,7 +191,7 @@
 
                clock-frequency = <24576000>;
 
        };
 
-       reg_12p0v: regulator1 {
+       reg_12p0v: regulator2 {
 
Quoted 3 lines
                compatible = "regulator-fixed";
                regulator-name = "D12.0V";
                regulator-min-microvolt = <12000000>;

Perhaps the node name should get a more descriptive suffix (e.g. "regulator-12p0v"), like is already done for some of the other regulators?

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

I think I would prefer that addressed in a follow-up patch.

Agreed, but it would still be a very good idea. I think we need to standardize names for regulators, otherwise this is bound to happen again in the future.

And so it did (patch sent for the same bug in r8a77995-draak.dts).

Quoted 3 lines

Isn't the YAML DT schema validator supposed to catch those problems ? I'd even expect DTC to be able to catch such duplicate nodes and warn about them.

DTC indeed has check_duplicate_node_names.
However, it only works for the base DTS, not for any later modifications in the board DTS.

I.e. the original dup-nodename.dts in the DTC testsuite triggers an error, but the modified version below doesn't.

tests/dup-nodename.dts +3 -0
@@ -1,8 +1,11 @@
 /dts-v1/;
 
+/ {
+};
+
 / {
        node {
        };
        node {
        };
 };

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Reviewed-by on v1 1/1
#8 lore raw
In reply to [email protected]

Hi Marek,

Thank you for the patch.

Quoted 7 lines · On Wednesday, 9 January 2019 16:00:45 EET [email protected] wrote:

From: Marek Vasut <[email protected]>

There are two regulator1 nodes in the Ebisu DTS right now, one 3.3V for the eMMC and one 12V for the backlight. This causes one to be overwritten by the other, ultimatelly resulting in inoperable eMMC, which depends on the former. Fix this by renumbering the backlight regulator to regulator2.

Quoted 7 lines
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Fixes 9d16c4a10e07 ("arm64: dts: renesas: r8a77990: ebisu: Add backlight")

Sorry for breaking this in the first place.

Quoted 18 lines
---
 arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts index e0590c0af4c4..89383aa35d65 100644

arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +1 -1
@@ -191,7 +191,7 @@
 		clock-frequency = <24576000>;
 	};
 
-	reg_12p0v: regulator1 {
+	reg_12p0v: regulator2 {
 		compatible = "regulator-fixed";
 		regulator-name = "D12.0V";
 		regulator-min-microvolt = <12000000>;
Signature · 3 lines
Regards,

Laurent Pinchart