diff mbox series

arm64: dts: meson-sm1-odroid: use correct enable-gpio pin for tf-io regulator

Message ID 20220126234325.GA7363@odroid-VirtualBox (mailing list archive)
State New, archived
Headers show
Series arm64: dts: meson-sm1-odroid: use correct enable-gpio pin for tf-io regulator | expand

Commit Message

Lutz Koschorreck Jan. 26, 2022, 11:43 p.m. UTC
The interrupt pin of the external ethernet phy is used, instead of the
enable-gpio pin of the tf-io regulator. The GPIOE_2 pin is located in
the gpio_ao bank.
Using open drain prevents reboot issues.

This causes phy interrupt problems at system startup.
[   76.645190] irq 36: nobody cared (try booting with the "irqpoll" option)
[   76.649617] CPU: 0 PID: 1416 Comm: irq/36-0.0:00 Not tainted 5.16.0 #2
[   76.649629] Hardware name: Hardkernel ODROID-HC4 (DT)
[   76.649635] Call trace:
[   76.649638]  dump_backtrace+0x0/0x1c8
[   76.649658]  show_stack+0x14/0x60
[   76.649667]  dump_stack_lvl+0x64/0x7c
[   76.649676]  dump_stack+0x14/0x2c
[   76.649683]  __report_bad_irq+0x38/0xe8
[   76.649695]  note_interrupt+0x220/0x3a0
[   76.649704]  handle_irq_event_percpu+0x58/0x88
[   76.649713]  handle_irq_event+0x44/0xd8
[   76.649721]  handle_fasteoi_irq+0xa8/0x130
[   76.649730]  generic_handle_domain_irq+0x38/0x58
[   76.649738]  gic_handle_irq+0x9c/0xb8
[   76.649747]  call_on_irq_stack+0x28/0x38
[   76.649755]  do_interrupt_handler+0x7c/0x80
[   76.649763]  el1_interrupt+0x34/0x80
[   76.649772]  el1h_64_irq_handler+0x14/0x20
[   76.649781]  el1h_64_irq+0x74/0x78
[   76.649788]  irq_finalize_oneshot.part.56+0x68/0xf8
[   76.649796]  irq_thread_fn+0x5c/0x98
[   76.649804]  irq_thread+0x13c/0x260
[   76.649812]  kthread+0x144/0x178
[   76.649822]  ret_from_fork+0x10/0x20
[   76.649830] handlers:
[   76.653170] [<0000000025a6cd31>] irq_default_primary_handler threaded [<0000000093580eb7>] phy_interrupt
[   76.661256] Disabling IRQ #36

Fixes: 1f80a5cf74a6 ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator")

Signed-off-by: Lutz Koschorreck <theleks@ko-hh.de>
---
 arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Neil Armstrong Jan. 27, 2022, 10:15 a.m. UTC | #1
Hi,

On 27/01/2022 00:43, Lutz Koschorreck wrote:
> The interrupt pin of the external ethernet phy is used, instead of the
> enable-gpio pin of the tf-io regulator. The GPIOE_2 pin is located in
> the gpio_ao bank.
> Using open drain prevents reboot issues.
> 
> This causes phy interrupt problems at system startup.
> [   76.645190] irq 36: nobody cared (try booting with the "irqpoll" option)
> [   76.649617] CPU: 0 PID: 1416 Comm: irq/36-0.0:00 Not tainted 5.16.0 #2
> [   76.649629] Hardware name: Hardkernel ODROID-HC4 (DT)
> [   76.649635] Call trace:
> [   76.649638]  dump_backtrace+0x0/0x1c8
> [   76.649658]  show_stack+0x14/0x60
> [   76.649667]  dump_stack_lvl+0x64/0x7c
> [   76.649676]  dump_stack+0x14/0x2c
> [   76.649683]  __report_bad_irq+0x38/0xe8
> [   76.649695]  note_interrupt+0x220/0x3a0
> [   76.649704]  handle_irq_event_percpu+0x58/0x88
> [   76.649713]  handle_irq_event+0x44/0xd8
> [   76.649721]  handle_fasteoi_irq+0xa8/0x130
> [   76.649730]  generic_handle_domain_irq+0x38/0x58
> [   76.649738]  gic_handle_irq+0x9c/0xb8
> [   76.649747]  call_on_irq_stack+0x28/0x38
> [   76.649755]  do_interrupt_handler+0x7c/0x80
> [   76.649763]  el1_interrupt+0x34/0x80
> [   76.649772]  el1h_64_irq_handler+0x14/0x20
> [   76.649781]  el1h_64_irq+0x74/0x78
> [   76.649788]  irq_finalize_oneshot.part.56+0x68/0xf8
> [   76.649796]  irq_thread_fn+0x5c/0x98
> [   76.649804]  irq_thread+0x13c/0x260
> [   76.649812]  kthread+0x144/0x178
> [   76.649822]  ret_from_fork+0x10/0x20
> [   76.649830] handlers:
> [   76.653170] [<0000000025a6cd31>] irq_default_primary_handler threaded [<0000000093580eb7>] phy_interrupt
> [   76.661256] Disabling IRQ #36
> 
> Fixes: 1f80a5cf74a6 ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator")
> 
> Signed-off-by: Lutz Koschorreck <theleks@ko-hh.de>
> ---
>  arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> index 0bd1e98a0eef..ddb1b345397f 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> @@ -48,7 +48,7 @@ tf_io: gpio-regulator-tf_io {
>  		regulator-max-microvolt = <3300000>;
>  		vin-supply = <&vcc_5v>;
>  
> -		enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
> +		enable-gpio = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;

Wow, indeed it's not the right GPIO chip... my bad.

>  		enable-active-high;
>  		regulator-always-on;
>  

Concerning the GPIO_OPEN_DRAIN, it's right since the line has a pull-up, does it really fix reboot issues ?

Anyway, can you split the changes ? First for gpio_ao, second for GPIO_OPEN_DRAIN ?

Neil
Lutz Koschorreck Jan. 27, 2022, 12:38 p.m. UTC | #2
On Thu, Jan 27, 2022 at 11:15:12AM +0100, Neil Armstrong wrote:
> Hi,
> 
> On 27/01/2022 00:43, Lutz Koschorreck wrote:
> > The interrupt pin of the external ethernet phy is used, instead of the
> > enable-gpio pin of the tf-io regulator. The GPIOE_2 pin is located in
> > the gpio_ao bank.
> > Using open drain prevents reboot issues.
> > 
> > This causes phy interrupt problems at system startup.
> > [   76.645190] irq 36: nobody cared (try booting with the "irqpoll" option)
> > [   76.649617] CPU: 0 PID: 1416 Comm: irq/36-0.0:00 Not tainted 5.16.0 #2
> > [   76.649629] Hardware name: Hardkernel ODROID-HC4 (DT)
> > [   76.649635] Call trace:
> > [   76.649638]  dump_backtrace+0x0/0x1c8
> > [   76.649658]  show_stack+0x14/0x60
> > [   76.649667]  dump_stack_lvl+0x64/0x7c
> > [   76.649676]  dump_stack+0x14/0x2c
> > [   76.649683]  __report_bad_irq+0x38/0xe8
> > [   76.649695]  note_interrupt+0x220/0x3a0
> > [   76.649704]  handle_irq_event_percpu+0x58/0x88
> > [   76.649713]  handle_irq_event+0x44/0xd8
> > [   76.649721]  handle_fasteoi_irq+0xa8/0x130
> > [   76.649730]  generic_handle_domain_irq+0x38/0x58
> > [   76.649738]  gic_handle_irq+0x9c/0xb8
> > [   76.649747]  call_on_irq_stack+0x28/0x38
> > [   76.649755]  do_interrupt_handler+0x7c/0x80
> > [   76.649763]  el1_interrupt+0x34/0x80
> > [   76.649772]  el1h_64_irq_handler+0x14/0x20
> > [   76.649781]  el1h_64_irq+0x74/0x78
> > [   76.649788]  irq_finalize_oneshot.part.56+0x68/0xf8
> > [   76.649796]  irq_thread_fn+0x5c/0x98
> > [   76.649804]  irq_thread+0x13c/0x260
> > [   76.649812]  kthread+0x144/0x178
> > [   76.649822]  ret_from_fork+0x10/0x20
> > [   76.649830] handlers:
> > [   76.653170] [<0000000025a6cd31>] irq_default_primary_handler threaded [<0000000093580eb7>] phy_interrupt
> > [   76.661256] Disabling IRQ #36
> > 
> > Fixes: 1f80a5cf74a6 ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator")
> > 
> > Signed-off-by: Lutz Koschorreck <theleks@ko-hh.de>
> > ---
> >  arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> > index 0bd1e98a0eef..ddb1b345397f 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> > +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> > @@ -48,7 +48,7 @@ tf_io: gpio-regulator-tf_io {
> >  		regulator-max-microvolt = <3300000>;
> >  		vin-supply = <&vcc_5v>;
> >  
> > -		enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
> > +		enable-gpio = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
> 
> Wow, indeed it's not the right GPIO chip... my bad.
> 
> >  		enable-active-high;
> >  		regulator-always-on;
> >  
> 
> Concerning the GPIO_OPEN_DRAIN, it's right since the line has a pull-up, does it really fix reboot issues ?
There is a 10k pull up on the pin of C4 and HC4. Therefore it is fine to
set to GPIO_OPEN_DRAIN. If this pin is left ACTIVE_HIGH and I call
reboot, the bootloader is does not came up, it is an boot loop. Tobetter
fixed that with a reset device driver, but I think using GPIO_OPEN_DRAIN
is the right solution.
> 
> Anyway, can you split the changes ? First for gpio_ao, second for GPIO_OPEN_DRAIN ?
Yes of cause. I will generate a new patch set.
> 
> Neil
> 
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
Lutz Koschorreck Jan. 30, 2022, 12:21 a.m. UTC | #3
On Thu, Jan 27, 2022 at 01:38:14PM +0100, Lutz Koschorreck wrote:
> On Thu, Jan 27, 2022 at 11:15:12AM +0100, Neil Armstrong wrote:
> > Hi,
> > 
> > On 27/01/2022 00:43, Lutz Koschorreck wrote:
> > > The interrupt pin of the external ethernet phy is used, instead of the
> > > enable-gpio pin of the tf-io regulator. The GPIOE_2 pin is located in
> > > the gpio_ao bank.
> > > Using open drain prevents reboot issues.
> > > 
> > > This causes phy interrupt problems at system startup.
> > > [   76.645190] irq 36: nobody cared (try booting with the "irqpoll" option)
> > > [   76.649617] CPU: 0 PID: 1416 Comm: irq/36-0.0:00 Not tainted 5.16.0 #2
> > > [   76.649629] Hardware name: Hardkernel ODROID-HC4 (DT)
> > > [   76.649635] Call trace:
> > > [   76.649638]  dump_backtrace+0x0/0x1c8
> > > [   76.649658]  show_stack+0x14/0x60
> > > [   76.649667]  dump_stack_lvl+0x64/0x7c
> > > [   76.649676]  dump_stack+0x14/0x2c
> > > [   76.649683]  __report_bad_irq+0x38/0xe8
> > > [   76.649695]  note_interrupt+0x220/0x3a0
> > > [   76.649704]  handle_irq_event_percpu+0x58/0x88
> > > [   76.649713]  handle_irq_event+0x44/0xd8
> > > [   76.649721]  handle_fasteoi_irq+0xa8/0x130
> > > [   76.649730]  generic_handle_domain_irq+0x38/0x58
> > > [   76.649738]  gic_handle_irq+0x9c/0xb8
> > > [   76.649747]  call_on_irq_stack+0x28/0x38
> > > [   76.649755]  do_interrupt_handler+0x7c/0x80
> > > [   76.649763]  el1_interrupt+0x34/0x80
> > > [   76.649772]  el1h_64_irq_handler+0x14/0x20
> > > [   76.649781]  el1h_64_irq+0x74/0x78
> > > [   76.649788]  irq_finalize_oneshot.part.56+0x68/0xf8
> > > [   76.649796]  irq_thread_fn+0x5c/0x98
> > > [   76.649804]  irq_thread+0x13c/0x260
> > > [   76.649812]  kthread+0x144/0x178
> > > [   76.649822]  ret_from_fork+0x10/0x20
> > > [   76.649830] handlers:
> > > [   76.653170] [<0000000025a6cd31>] irq_default_primary_handler threaded [<0000000093580eb7>] phy_interrupt
> > > [   76.661256] Disabling IRQ #36
> > > 
> > > Fixes: 1f80a5cf74a6 ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator")
> > > 
> > > Signed-off-by: Lutz Koschorreck <theleks@ko-hh.de>
> > > ---
> > >  arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> > > index 0bd1e98a0eef..ddb1b345397f 100644
> > > --- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> > > +++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
> > > @@ -48,7 +48,7 @@ tf_io: gpio-regulator-tf_io {
> > >  		regulator-max-microvolt = <3300000>;
> > >  		vin-supply = <&vcc_5v>;
> > >  
> > > -		enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
> > > +		enable-gpio = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
> > 
> > Wow, indeed it's not the right GPIO chip... my bad.
> > 
> > >  		enable-active-high;
> > >  		regulator-always-on;
> > >  
> > 
> > Concerning the GPIO_OPEN_DRAIN, it's right since the line has a pull-up, does it really fix reboot issues ?
> There is a 10k pull up on the pin of C4 and HC4. Therefore it is fine to
> set to GPIO_OPEN_DRAIN. If this pin is left ACTIVE_HIGH and I call
> reboot, the bootloader is does not came up, it is an boot loop. Tobetter
> fixed that with a reset device driver, but I think using GPIO_OPEN_DRAIN
> is the right solution.
Sorry, this comment is not entirely correct. The GPIO_OPEN_DRAIN is
needed to fix a boot loop at bl2 level. Also it look like that the reset
driver fixes the boot loop at BL3X boot level and is needed for proper
operation.
> > 
> > Anyway, can you split the changes ? First for gpio_ao, second for GPIO_OPEN_DRAIN ?
> Yes of cause. I will generate a new patch set.
> > 
> > Neil
> > 
> > 
> > _______________________________________________
> > linux-amlogic mailing list
> > linux-amlogic@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-amlogic
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
index 0bd1e98a0eef..ddb1b345397f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi
@@ -48,7 +48,7 @@  tf_io: gpio-regulator-tf_io {
 		regulator-max-microvolt = <3300000>;
 		vin-supply = <&vcc_5v>;
 
-		enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
+		enable-gpio = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
 		enable-active-high;
 		regulator-always-on;