diff mbox

ARM: dts: meson: fixing USB support on Meson6, Meson8 and Meson8b

Message ID 20170922115708.GA14806@ingrassia.epigenesys.com (mailing list archive)
State Accepted
Headers show

Commit Message

Emiliano Ingrassia Sept. 22, 2017, 11:57 a.m. UTC
This patch fixes the Meson6, Meson8 and Meson8b USB controllers dts nodes
which interrupts are level type instead of edge type.
This avoids errors like "usb 1-1-port1: cannot reset (err = -110)" and
similars on Odroid-C1+ board.

Fixes: e29b1cf87473 ("ARM: dts: meson: add USB support on Meson8 and Meson8b")

Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com>
---
 arch/arm/boot/dts/meson.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Martin Blumenstingl Sept. 23, 2017, 1:15 p.m. UTC | #1
On Fri, Sep 22, 2017 at 1:57 PM, Emiliano Ingrassia
<ingrassia@epigenesys.com> wrote:
> This patch fixes the Meson6, Meson8 and Meson8b USB controllers dts nodes
> which interrupts are level type instead of edge type.
> This avoids errors like "usb 1-1-port1: cannot reset (err = -110)" and
> similars on Odroid-C1+ board.
>
> Fixes: e29b1cf87473 ("ARM: dts: meson: add USB support on Meson8 and Meson8b")
>
> Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com>

USB on my Meson8 (Meson8m2 to be exact) board still works fine (just
like before - maybe that was a fluke though...), confirmed by reading
a USB thumb drive to /dev/null:

Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

as well as (me being the one who originally didn't do this right):

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

> ---
>  arch/arm/boot/dts/meson.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
> index cd6ad072e72c..bf270806a688 100644
> --- a/arch/arm/boot/dts/meson.dtsi
> +++ b/arch/arm/boot/dts/meson.dtsi
> @@ -217,7 +217,7 @@
>                         #address-cells = <1>;
>                         #size-cells = <0>;
>                         reg = <0xc9040000 0x40000>;
> -                       interrupts = <GIC_SPI 30 IRQ_TYPE_EDGE_RISING>;
> +                       interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
>                         phys = <&usb0_phy>;
>                         phy-names = "usb2-phy";
>                         dr_mode = "host";
> @@ -229,7 +229,7 @@
>                         #address-cells = <1>;
>                         #size-cells = <0>;
>                         reg = <0xc90c0000 0x40000>;
> -                       interrupts = <GIC_SPI 31 IRQ_TYPE_EDGE_RISING>;
> +                       interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
>                         phys = <&usb1_phy>;
>                         phy-names = "usb2-phy";
>                         dr_mode = "host";
> --
> 2.14.1
>
Linus Lüssing Sept. 24, 2017, 4:28 a.m. UTC | #2
On Fri, Sep 22, 2017 at 01:57:08PM +0200, Emiliano Ingrassia wrote:
> This patch fixes the Meson6, Meson8 and Meson8b USB controllers dts nodes
> which interrupts are level type instead of edge type.
> This avoids errors like "usb 1-1-port1: cannot reset (err = -110)" and
> similars on Odroid-C1+ board.
> 
> Fixes: e29b1cf87473 ("ARM: dts: meson: add USB support on Meson8 and Meson8b")
> 
> Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com>

Hi Emiliano,

Yes! I can confirm that these two patches made me able to boot a
Debian unstable from a USB stick on an Odroid C1+ for the first time.
I tested both a v4.13.2 kernel and a v4.14-rc1 with the SMP
patches included.


I'm having one oddity with the stress-ng tool though: Several
filesystem related tests make the Odroid hang for me. This works for
me:

$ cd /tmp/; time stress-ng -v --class filesystem --sequential 1 --exclude copy-file -t 30s
(with /tmp being a tmpfs)

Those tests make the system hang for me almost immediately, though:

$ cd ~/; time stress-ng -v -t 30s --chdir 1
$ cd ~/; time stress-ng -v -t 30s --dir 1
$ cd ~/; time stress-ng -v -t 30s --dirdeep 1
$ cd ~/; time stress-ng -v -t 30s --fallocate 1
$ cd ~/; time stress-ng -v -t 30s --mknod 1
$ cd ~/; time stress-ng -v -t 30s --sync-file 1
$ cd ~/; time stress-ng -v -t 30s --xattr 1

Unfortunately, there is no error message on my serial console
then, it just hangs silently with the heartbeat LED stopping to
blink.

I also tried:

* Using a USB connected hdd instead of the USB flash drive, with
  an actively powered USB hub in between.
* Using a clean v4.13.2 with the patched v4.14-rc1 DTB file
  instead of v4.14-rc1 kernel (with the SMP patches included).

Both without success. I also experienced a two freezes while
apt-get installing a few patches.

Anyone having an idea how I could make those crashes more
verbose or what else I could try? Or could it be that it freezes
so silently due to some sort of internal power issues? (I got a
little paranoid with power stuff since the confirmed,
hardware related power issues on the Odroid U3)

Regards, Linus
Linus Lüssing Sept. 24, 2017, 4:42 a.m. UTC | #3
> Or could it be that it freezes
> so silently due to some sort of internal power issues? (I got a
> little paranoid with power stuff since the confirmed,
> hardware related power issues on the Odroid U3)

Although the USB powering seems to work way better with the Odroid
C1+ than with my Odroid U3:

When connecting the HDD via USB directly without the HUB, I can
hear the disk trying to spin up, then audibly failing (while
spin-up with the actively powered HUB works just fine). Even
though the kernel tries to respin it again and again, the system
itself stays stable.

On the Odroid U3, connecting this HDD via USB would make the
Odroid U3 crash or the internal USB hub or ethernet device
(internally wired to the same USB chip, if I understood
correctly?) vanish for me.

(So probably not a power issue on the Odroid C1+?)

Regards, Linus
Emiliano Ingrassia Sept. 25, 2017, 10:48 p.m. UTC | #4
On Sun, Sep 24, 2017 at 06:28:03AM +0200, Linus Lüssing wrote:
> On Fri, Sep 22, 2017 at 01:57:08PM +0200, Emiliano Ingrassia wrote:
> > This patch fixes the Meson6, Meson8 and Meson8b USB controllers dts nodes
> > which interrupts are level type instead of edge type.
> > This avoids errors like "usb 1-1-port1: cannot reset (err = -110)" and
> > similars on Odroid-C1+ board.
> > 
> > Fixes: e29b1cf87473 ("ARM: dts: meson: add USB support on Meson8 and Meson8b")
> > 
> > Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com>
> 

Hi Linus,

> Hi Emiliano,
> 
> Yes! I can confirm that these two patches made me able to boot a
> Debian unstable from a USB stick on an Odroid C1+ for the first time.
> I tested both a v4.13.2 kernel and a v4.14-rc1 with the SMP
> patches included.
> 

Good to hear! Thanks for testing.

> 
> I'm having one oddity with the stress-ng tool though: Several
> filesystem related tests make the Odroid hang for me. This works for
> me:
> 
> $ cd /tmp/; time stress-ng -v --class filesystem --sequential 1 --exclude copy-file -t 30s
> (with /tmp being a tmpfs)
> 
> Those tests make the system hang for me almost immediately, though:
> 
> $ cd ~/; time stress-ng -v -t 30s --chdir 1
> $ cd ~/; time stress-ng -v -t 30s --dir 1
> $ cd ~/; time stress-ng -v -t 30s --dirdeep 1
> $ cd ~/; time stress-ng -v -t 30s --fallocate 1
> $ cd ~/; time stress-ng -v -t 30s --mknod 1
> $ cd ~/; time stress-ng -v -t 30s --sync-file 1
> $ cd ~/; time stress-ng -v -t 30s --xattr 1
> 

I'm sorry, as soon as I can I'll try those tests on my board.

> Unfortunately, there is no error message on my serial console
> then, it just hangs silently with the heartbeat LED stopping to
> blink.
> 
> I also tried:
> 
> * Using a USB connected hdd instead of the USB flash drive, with
>   an actively powered USB hub in between.
> * Using a clean v4.13.2 with the patched v4.14-rc1 DTB file
>   instead of v4.14-rc1 kernel (with the SMP patches included).
> 
> Both without success. I also experienced a two freezes while
> apt-get installing a few patches.
>

Could you list all the kernels you have tried (included versions and patches) ?

> Anyone having an idea how I could make those crashes more
> verbose or what else I could try? Or could it be that it freezes
> so silently due to some sort of internal power issues? (I got a
> little paranoid with power stuff since the confirmed,
> hardware related power issues on the Odroid U3)
> 
> Regards, Linus

Regards,

Emiliano
Linus Lüssing Sept. 28, 2017, 2:51 p.m. UTC | #5
On Tue, Sep 26, 2017 at 12:48:02AM +0200, Emiliano Ingrassia wrote:
> Could you list all the kernels you have tried (included versions and patches) ?

I tried your two patches with:

A) a clean multi_v7_defconfig and no extra patches on:
* 4.13.2
* 4.13.3

B) a multi_v7_defconfig excluding CONFIG_DRM_TEGRA
(causes build errors):
* 4.14.0-rc1, no extra patches
* 4.14.0-rc2, no extra patches
* 4.14.0-rc1, with SMP patches [0]

All these kernels hung for me for the mentioned stress-ng tests
almost immediately.

I was also lucky to at least get a glimpse at a kernel crash
output during a chdir test once. Unfortunately still cut very early:

~~~
[   97.499390] Unhandled fault: external abort on non-linefetch (0x1008) at 0
~~~

Regards, Linus


[0]:
81d519f ARM: dts: meson8b: add support for booting the secondary CPU cores
85ded56 ARM: dts: meson8: add support for booting the secondary CPU cores
c70daa9 ARM: meson: Add SMP bringup code for Meson8 and Meson8b
a39342c ARM: smp_scu: allow the platform code to read the SCU CPU status
0b1863d ARM: smp_scu: add a helper for powering on a specific CPU 
27efddb dt-bindings: Amlogic: Add Meson8 and Meson8b SMP related documentation
Linus Lüssing Sept. 28, 2017, 3:56 p.m. UTC | #6
Hi,

I just noticed this patch from Martin:

    8a7f0c5 ARM: dts: meson8: add reserved memory zones

And I simply copied those two reserved memory regions from
meson8.dtsi to meson8b.dtsi.

It worked :-) \o/.

It fixed the following issues for me all together:

* stress-ng filesystem stressors as mentioned in previous mail all
  worked now
* stress-ng memory tests now worked without either not hanging the
  kernel or at least:
* fixed the OOM killer and reboot-on-panic. Before, on OOM the
  system would just freeze silently, even with reboot-on-panic
  configured (vm.panic_on_oom=1, kernel.panic=10 in systctl.conf)
* fixed reboots. Before, a "$ reboot" would result in shutdown
  just fine, but would hang when trying to load the kernel again,
  right after u-boot (last line: "Starting kernel ...")

Regards, Linus
Linus Lüssing Sept. 28, 2017, 4:35 p.m. UTC | #7
On Sat, Sep 23, 2017 at 03:15:23PM +0200, Martin Blumenstingl wrote:
> > Fixes: e29b1cf87473 ("ARM: dts: meson: add USB support on Meson8 and Meson8b")
> >
> > Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com>
> 
> USB on my Meson8 (Meson8m2 to be exact) board still works fine (just
> like before - maybe that was a fluke though...), confirmed by reading
> a USB thumb drive to /dev/null:
> 
> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> 
> as well as (me being the one who originally didn't do this right):
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

As the freezes seems to be caused by something else and stress-ng works
fine for me now on an Odroid C1+ (at least with the reserved
memory regions):

Tested-by: Linus Lüssing <linus.luessing@c0d3.blue>

Cheers
Emiliano Ingrassia Sept. 28, 2017, 6:37 p.m. UTC | #8
Hi Linus,

On Thu, Sep 28, 2017 at 05:56:26PM +0200, Linus Lüssing wrote:
> Hi,
> 
> I just noticed this patch from Martin:
> 
>     8a7f0c5 ARM: dts: meson8: add reserved memory zones
> 
> And I simply copied those two reserved memory regions from
> meson8.dtsi to meson8b.dtsi.
> 
> It worked :-) \o/.
> 
> It fixed the following issues for me all together:
> 
> * stress-ng filesystem stressors as mentioned in previous mail all
>   worked now
> * stress-ng memory tests now worked without either not hanging the
>   kernel or at least:
> * fixed the OOM killer and reboot-on-panic. Before, on OOM the
>   system would just freeze silently, even with reboot-on-panic
>   configured (vm.panic_on_oom=1, kernel.panic=10 in systctl.conf)
> * fixed reboots. Before, a "$ reboot" would result in shutdown
>   just fine, but would hang when trying to load the kernel again,
>   right after u-boot (last line: "Starting kernel ...")
> 

Great work!

Would you mind to submit the same patch for Meson8b or ask Martin to do it ?

> Regards, Linus

Thank you,

Emiliano
Kevin Hilman Oct. 6, 2017, 10:24 p.m. UTC | #9
Emiliano Ingrassia <ingrassia@epigenesys.com> writes:

> This patch fixes the Meson6, Meson8 and Meson8b USB controllers dts nodes
> which interrupts are level type instead of edge type.
> This avoids errors like "usb 1-1-port1: cannot reset (err = -110)" and
> similars on Odroid-C1+ board.
>
> Fixes: e29b1cf87473 ("ARM: dts: meson: add USB support on Meson8 and Meson8b")
>
> Signed-off-by: Emiliano Ingrassia <ingrassia@epigenesys.com>

Applied to v4.15/dt,

Thanks,

Kevin
diff mbox

Patch

diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
index cd6ad072e72c..bf270806a688 100644
--- a/arch/arm/boot/dts/meson.dtsi
+++ b/arch/arm/boot/dts/meson.dtsi
@@ -217,7 +217,7 @@ 
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xc9040000 0x40000>;
-			interrupts = <GIC_SPI 30 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
 			phys = <&usb0_phy>;
 			phy-names = "usb2-phy";
 			dr_mode = "host";
@@ -229,7 +229,7 @@ 
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xc90c0000 0x40000>;
-			interrupts = <GIC_SPI 31 IRQ_TYPE_EDGE_RISING>;
+			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
 			phys = <&usb1_phy>;
 			phy-names = "usb2-phy";
 			dr_mode = "host";