ARM: mvebu: fix usb on Linksys Caiman
Subsystems (2)
PATCH 1/1 ARM: mvebu: fix usb on Linksys Caiman
Hi,
These patches fix the USB ports on Linksys Caiman (WRT1200AC) on 4.6rc1. After a lot of trial and error, I found out that if there's any unit with name "usb at 58000" defined, none of the USB ports work, but if I change it to anything else, the USB3 port comes up. And if I then also bring the linksys.dtsi unit name in sync (and different from USB at 58000), the USB2 port also comes up.
I can change it to literally anything else: nonsense at 58000 and usb at 58001 work, it's only usb at 58000 that doesn't work as far as I have found. Since the ehci-orion documentation gives the example of ehci at 50000, I just brought all of the Orion EHCI device tree definitions in sync with this.
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
According to Documentation/devicetree/bindings/usb/ehci-orion.txt, the Orion Marvell variant of EHCI controllers should have names ehci at 50000 for example.
--- arch/arm/boot/dts/armada-370-db.dts | 4 ++-- arch/arm/boot/dts/armada-370-dlink-dns327l.dts | 2 +- arch/arm/boot/dts/armada-370-mirabox.dts | 4 ++-- arch/arm/boot/dts/armada-370-netgear-rn102.dts | 2 +- arch/arm/boot/dts/armada-370-netgear-rn104.dts | 2 +- arch/arm/boot/dts/armada-370-rd.dts | 4 ++-- arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi | 2 +- arch/arm/boot/dts/armada-370-synology-ds213j.dts | 4 ++-- arch/arm/boot/dts/armada-370-xp.dtsi | 4 ++-- arch/arm/boot/dts/armada-370.dtsi | 4 ++-- arch/arm/boot/dts/armada-375-db.dts | 2 +- arch/arm/boot/dts/armada-375.dtsi | 4 ++-- arch/arm/boot/dts/armada-385-linksys.dtsi | 2 +- arch/arm/boot/dts/armada-388-clearfog.dts | 2 +- arch/arm/boot/dts/armada-388-db.dts | 2 +- arch/arm/boot/dts/armada-388-gp.dts | 2 +- arch/arm/boot/dts/armada-38x.dtsi | 2 +- arch/arm/boot/dts/armada-xp-db.dts | 6 +++--- arch/arm/boot/dts/armada-xp-gp.dts | 4 ++-- arch/arm/boot/dts/armada-xp-lenovo-ix4-300d.dts | 4 ++-- arch/arm/boot/dts/armada-xp-linksys-mamba.dts | 2 +- arch/arm/boot/dts/armada-xp-matrix.dts | 2 +- arch/arm/boot/dts/armada-xp-netgear-rn2120.dts | 2 +- arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | 4 ++-- arch/arm/boot/dts/armada-xp-synology-ds414.dts | 2 +- arch/arm/boot/dts/armada-xp.dtsi | 2 +- 26 files changed, 38 insertions(+), 38 deletions(-)
arch/arm/boot/dts/armada-370-db.dts +2 -2
@@ -147,11 +147,11 @@ broken-cd; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-370-dlink-dns327l.dts +1 -1
@@ -92,7 +92,7 @@ status = "okay"; }; - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-370-mirabox.dts +2 -2
@@ -154,11 +154,11 @@ broken-cd; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-370-netgear-rn102.dts +1 -1
@@ -115,7 +115,7 @@ phy-mode = "rgmii-id"; }; - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-370-netgear-rn104.dts +1 -1
@@ -121,7 +121,7 @@ phy-mode = "rgmii-id"; }; - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-370-rd.dts +2 -2
@@ -134,11 +134,11 @@ broken-cd; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi +1 -1
@@ -88,7 +88,7 @@ }; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; };
arch/arm/boot/dts/armada-370-synology-ds213j.dts +2 -2
@@ -174,12 +174,12 @@ }; /* rear USB port, near reset button */ - usb at 50000 { + ehci at 50000 { status = "okay"; }; /* rear USB port, near RJ45 port */ - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-370-xp.dtsi +2 -2
@@ -253,14 +253,14 @@ reg = <0x22000 0x1000>; }; - usb at 50000 { + ehci at 50000 { compatible = "marvell,orion-ehci"; reg = <0x50000 0x500>; interrupts = <45>; status = "disabled"; }; - usb at 51000 { + ehci at 51000 { compatible = "marvell,orion-ehci"; reg = <0x51000 0x500>; interrupts = <46>;
arch/arm/boot/dts/armada-370.dtsi +2 -2
@@ -271,11 +271,11 @@ status = "disabled"; }; - usb at 50000 { + ehci at 50000 { clocks = <&coreclk 0>; }; - usb at 51000 { + ehci at 51000 { clocks = <&coreclk 0>; };
arch/arm/boot/dts/armada-375-db.dts +1 -1
@@ -144,7 +144,7 @@ }; }; - usb at 54000 { + ehci at 54000 { status = "okay"; };
arch/arm/boot/dts/armada-375.dtsi +2 -2
@@ -445,7 +445,7 @@ reg = <0x21010 0x1c>; }; - usb at 50000 { + ehci at 50000 { compatible = "marvell,orion-ehci"; reg = <0x50000 0x500>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
@@ -455,7 +455,7 @@ status = "disabled"; }; - usb at 54000 { + ehci at 54000 { compatible = "marvell,orion-ehci"; reg = <0x54000 0x500>; interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/armada-385-linksys.dtsi +1 -1
@@ -117,7 +117,7 @@ }; /* USB part of the eSATA/USB 2.0 port */ - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-388-clearfog.dts +1 -1
@@ -355,7 +355,7 @@ }; }; - usb at 58000 { + ehci at 58000 { /* CON3, nearest power. */ status = "okay"; };
arch/arm/boot/dts/armada-388-db.dts +1 -1
@@ -105,7 +105,7 @@ bm,pool-short = <3>; }; - usb at 58000 { + ehci at 58000 { status = "ok"; };
arch/arm/boot/dts/armada-388-gp.dts +1 -1
@@ -140,7 +140,7 @@ }; /* CON4 */ - usb at 58000 { + ehci at 58000 { vcc-supply = <®_usb2_0_vbus>; status = "okay"; };
arch/arm/boot/dts/armada-38x.dtsi +1 -1
@@ -466,7 +466,7 @@ status = "disabled"; }; - usb at 58000 { + ehci at 58000 { compatible = "marvell,orion-ehci"; reg = <0x58000 0x500>; interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/armada-xp-db.dts +3 -3
@@ -219,15 +219,15 @@ broken-cd; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; - usb at 51000 { + ehci at 51000 { status = "okay"; }; - usb at 52000 { + ehci at 52000 { status = "okay"; };
arch/arm/boot/dts/armada-xp-gp.dts +2 -2
@@ -223,12 +223,12 @@ }; /* Front-side USB slot */ - usb at 50000 { + ehci at 50000 { status = "okay"; }; /* Back-side USB slot */ - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-xp-lenovo-ix4-300d.dts +2 -2
@@ -115,11 +115,11 @@ phy-mode = "rgmii-id"; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-xp-linksys-mamba.dts +1 -1
@@ -135,7 +135,7 @@ }; /* USB part of the eSATA/USB 2.0 port */ - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-xp-matrix.dts +1 -1
@@ -108,7 +108,7 @@ }; }; - usb at 50000 { + ehci at 50000 { status = "okay"; }; };
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts +1 -1
@@ -150,7 +150,7 @@ }; /* Front USB 2.0 port */ - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +2 -2
@@ -220,12 +220,12 @@ }; /* Front side USB 0 */ - usb at 50000 { + ehci at 50000 { status = "okay"; }; /* Front side USB 1 */ - usb at 51000 { + ehci at 51000 { status = "okay"; };
arch/arm/boot/dts/armada-xp-synology-ds414.dts +1 -1
@@ -202,7 +202,7 @@ }; /* Front USB 2.0 port */ - usb at 50000 { + ehci at 50000 { status = "okay"; };
arch/arm/boot/dts/armada-xp.dtsi +1 -1
@@ -205,7 +205,7 @@ clocks = <&gateclk 19>; }; - usb at 52000 { + ehci at 52000 { compatible = "marvell,orion-ehci"; reg = <0x52000 0x500>; interrupts = <47>;
Signature · 1 line
2.7.4
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
Quoted 6 lines · On Tuesday 29 March 2016 13:56:52 Patrick Uiterwijk wrote:
According to
Documentation/devicetree/bindings/usb/ehci-orion.txt, the Orion Marvell variant of EHCI controllers should have names ehci at 50000 for example.Signed-off-by Patrick Uiterwijk <[email protected]>
I think it's better to follow the generic USB binding that suggests the name of 'usb', unless we understand what the specific bug is you run into. Do you think it is the boot loader that messes up the hardware, or something in the kernel that goes wrong? Did it work on earlier kernels?
We had a regression based on the USB device probing, but that should be fixed now with the patch below. Do you have that?
Arnd
commit 7222c832254a75dcd67d683df75753d4a4e125bb
Author: Nicolai Stange <[email protected]> Date: Thu Mar 17 23:53:02 2016 +0100
usb/core: usb_alloc_dev(): fix setting of ->portnum
With commit 69bec7259853 ("USB: core: let USB device know device node"),
the port1 argument of usb_alloc_dev() gets overwritten as follows:
... usb_alloc_dev(..., unsigned port1)
{
...
if (!parent->parent) {
port1 = usb_hcd_find_raw_port_number(..., port1);
}
...
}
Later on, this now overwritten port1 gets assigned to ->portnum:
dev->portnum = port1;
However, since xhci_find_raw_port_number() isn't idempotent, the
aforementioned commit causes a number of KASAN splats like the following:
BUG: KASAN: slab-out-of-bounds in xhci_find_raw_port_number+0x98/0x170
at addr ffff8801d9311670
Read of size 8 by task kworker/2:1/87
[...]
Workqueue: usb_hub_wq hub_event
0000000000000188 000000005814b877 ffff8800cba17588 ffffffff8191447e
0000000041b58ab3 ffffffff82a03209 ffffffff819143a2 ffffffff82a252f4
ffff8801d93115e0 0000000000000188 ffff8801d9311628 ffff8800cba17588
Call Trace:
[<ffffffff8191447e>] dump_stack+0xdc/0x15e
[<ffffffff819143a2>] ? _atomic_dec_and_lock+0xa2/0xa2
[<ffffffff814e2cd1>] ? print_section+0x61/0xb0
[<ffffffff814e4939>] print_trailer+0x179/0x2c0
[<ffffffff814f0d84>] object_err+0x34/0x40
[<ffffffff814f4388>] kasan_report_error+0x2f8/0x8b0
[<ffffffff814eb91e>] ? __slab_alloc+0x5e/0x90
[<ffffffff812178c0>] ? __lock_is_held+0x90/0x130
[<ffffffff814f5091>] kasan_report+0x71/0xa0
[<ffffffff814ec082>] ? kmem_cache_alloc_trace+0x212/0x560
[<ffffffff81d99468>] ? xhci_find_raw_port_number+0x98/0x170
[<ffffffff814f33d4>] __asan_load8+0x64/0x70
[<ffffffff81d99468>] xhci_find_raw_port_number+0x98/0x170
[<ffffffff81db0105>] xhci_setup_addressable_virt_dev+0x235/0xa10
[<ffffffff81d9ea51>] xhci_setup_device+0x3c1/0x1430
[<ffffffff8121cddd>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff81d9fac0>] ? xhci_setup_device+0x1430/0x1430
[<ffffffff81d9fad3>] xhci_address_device+0x13/0x20
[<ffffffff81d2081a>] hub_port_init+0x55a/0x1550
[<ffffffff81d28705>] hub_event+0xef5/0x24d0
[<ffffffff81d27810>] ? hub_port_debounce+0x2f0/0x2f0
[<ffffffff8195e1ee>] ? debug_object_deactivate+0x1be/0x270
[<ffffffff81210203>] ? print_rt_rq+0x53/0x2d0
[<ffffffff8121657d>] ? trace_hardirqs_off+0xd/0x10
[<ffffffff8226acfb>] ? _raw_spin_unlock_irqrestore+0x5b/0x60
[<ffffffff81250000>] ? irq_domain_set_hwirq_and_chip+0x30/0xb0
[<ffffffff81256339>] ? debug_lockdep_rcu_enabled+0x39/0x40
[<ffffffff812178c0>] ? __lock_is_held+0x90/0x130
[<ffffffff81196877>] process_one_work+0x567/0xec0
[...]
Afterwards, xhci reports some functional errors:
xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion
code 0x11.
xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion
code 0x11.
usb 4-3: device not accepting address 2, error -22
Fix this by not overwriting the port1 argument in usb_alloc_dev(), but
storing the raw port number as required by OF in an additional variable,
raw_port.
Fixes: 69bec7259853 ("USB: core: let USB device know device node")
Signed-off-by: Nicolai Stange <[email protected]>
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>drivers/usb/core/usb.c +3 -2
@@ -424,6 +424,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,struct usb_device *dev;struct usb_hcd *usb_hcd =bus_to_hcd (bus);unsigned root_hub =0 ; +unsigned raw_port = port1; dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (!dev)
@@ -498,11 +499,11 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,if (!parent->parent) {/* device under root hub's port */ - port1 =usb_hcd_find_raw_port_number (usb_hcd, + raw_port =usb_hcd_find_raw_port_number (usb_hcd, port1); } dev->dev.of_node =usb_of_get_child_node (parent->dev.of_node, - port1); + raw_port);/* hub driver sets up TT records */ }
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
Hi Arnd,
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · On Tuesday 29 March 2016 13:56:52 Patrick Uiterwijk wrote:
According to
Documentation/devicetree/bindings/usb/ehci-orion.txt, the Orion Marvell variant of EHCI controllers should have names ehci at 50000 for example.
Quoted 9 lines
Quoted 2 lines
Signed-off-by Patrick Uiterwijk <[email protected]>I think it's better to follow the generic USB binding that suggests the name of 'usb', unless we understand what the specific bug is you run into. Do you think it is the boot loader that messes up the hardware, or something in the kernel that goes wrong? Did it work on earlier kernels?
I am pretty sure that this issue is caused by the Marvell U-Boot which tries to modify the dts on the fly. But the device tree reference of this U-boot is not the one we use in mainline, so at end it mess up the dtb!
There is an option to ask Marvell bootloader to not modify the dts, I think it is something like ftd_skip.
Gregory
Quoted 115 lines
We had a regression based on the USB device probing, but that should be fixed now with the patch below. Do you have that?
Arnd
commit
7222c832254a75dcd67d683df75753d4a4e125bbAuthor: Nicolai Stange <[email protected]> Date: Thu Mar 17 23:53:02 2016 +0100usb/core: usb_alloc_dev(): fix setting of ->portnum With commit 69bec7259853 ("USB: core: let USB device know device node"), the port1 argument of usb_alloc_dev() gets overwritten as follows: ... usb_alloc_dev(..., unsigned port1) { ... if (!parent->parent) { port1 = usb_hcd_find_raw_port_number(..., port1); } ... } Later on, this now overwritten port1 gets assigned to ->portnum: dev->portnum = port1; However, since xhci_find_raw_port_number() isn't idempotent, the aforementioned commit causes a number of KASAN splats like the following: BUG: KASAN: slab-out-of-bounds in xhci_find_raw_port_number+0x98/0x170 at addr ffff8801d9311670 Read of size 8 by task kworker/2:1/87 [...] Workqueue: usb_hub_wq hub_event 0000000000000188 000000005814b877 ffff8800cba17588 ffffffff8191447e 0000000041b58ab3 ffffffff82a03209 ffffffff819143a2 ffffffff82a252f4 ffff8801d93115e0 0000000000000188 ffff8801d9311628 ffff8800cba17588 Call Trace: [<ffffffff8191447e>] dump_stack+0xdc/0x15e [<ffffffff819143a2>] ? _atomic_dec_and_lock+0xa2/0xa2 [<ffffffff814e2cd1>] ? print_section+0x61/0xb0 [<ffffffff814e4939>] print_trailer+0x179/0x2c0 [<ffffffff814f0d84>] object_err+0x34/0x40 [<ffffffff814f4388>] kasan_report_error+0x2f8/0x8b0 [<ffffffff814eb91e>] ? __slab_alloc+0x5e/0x90 [<ffffffff812178c0>] ? __lock_is_held+0x90/0x130 [<ffffffff814f5091>] kasan_report+0x71/0xa0 [<ffffffff814ec082>] ? kmem_cache_alloc_trace+0x212/0x560 [<ffffffff81d99468>] ? xhci_find_raw_port_number+0x98/0x170 [<ffffffff814f33d4>] __asan_load8+0x64/0x70 [<ffffffff81d99468>] xhci_find_raw_port_number+0x98/0x170 [<ffffffff81db0105>] xhci_setup_addressable_virt_dev+0x235/0xa10 [<ffffffff81d9ea51>] xhci_setup_device+0x3c1/0x1430 [<ffffffff8121cddd>] ? trace_hardirqs_on+0xd/0x10 [<ffffffff81d9fac0>] ? xhci_setup_device+0x1430/0x1430 [<ffffffff81d9fad3>] xhci_address_device+0x13/0x20 [<ffffffff81d2081a>] hub_port_init+0x55a/0x1550 [<ffffffff81d28705>] hub_event+0xef5/0x24d0 [<ffffffff81d27810>] ? hub_port_debounce+0x2f0/0x2f0 [<ffffffff8195e1ee>] ? debug_object_deactivate+0x1be/0x270 [<ffffffff81210203>] ? print_rt_rq+0x53/0x2d0 [<ffffffff8121657d>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff8226acfb>] ? _raw_spin_unlock_irqrestore+0x5b/0x60 [<ffffffff81250000>] ? irq_domain_set_hwirq_and_chip+0x30/0xb0 [<ffffffff81256339>] ? debug_lockdep_rcu_enabled+0x39/0x40 [<ffffffff812178c0>] ? __lock_is_held+0x90/0x130 [<ffffffff81196877>] process_one_work+0x567/0xec0 [...] Afterwards, xhci reports some functional errors: xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion code 0x11. xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion code 0x11. usb 4-3: device not accepting address 2, error -22 Fix this by not overwriting the port1 argument in usb_alloc_dev(), but storing the raw port number as required by OF in an additional variable, raw_port. Fixes: 69bec7259853 ("USB: core: let USB device know device node") Signed-off-by: Nicolai Stange <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>drivers/usb/core/usb.c +3
-2@@ -424,6 +424,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,struct usb_device *dev;struct usb_hcd *usb_hcd =bus_to_hcd (bus);unsigned root_hub =0 ; +unsigned raw_port = port1; dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (!dev)@@ -498,11 +499,11 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,if (!parent->parent) {/* device under root hub's port */ - port1 =usb_hcd_find_raw_port_number (usb_hcd, + raw_port =usb_hcd_find_raw_port_number (usb_hcd, port1); } dev->dev.of_node =usb_of_get_child_node (parent->dev.of_node, - port1); + raw_port);/* hub driver sets up TT records */ }
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
Quoted 19 lines · Gregory CLEMENT
Hi Arnd,
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · On Tuesday 29 March 2016 13:56:52 Patrick Uiterwijk wrote:
According to
Documentation/devicetree/bindings/usb/ehci-orion.txt, the Orion Marvell variant of EHCI controllers should have names ehci at 50000 for example.Quoted 9 lines
Quoted 2 lines
Signed-off-by Patrick Uiterwijk <[email protected]>I think it's better to follow the generic USB binding that suggests the name of 'usb', unless we understand what the specific bug is you run into. Do you think it is the boot loader that messes up the hardware, or something in the kernel that goes wrong? Did it work on earlier kernels?
Quoted 7 lines
I am pretty sure that this issue is caused by the Marvell U-Boot which tries to modify the dts on the fly. But the device tree reference of this U-boot is not the one we use in mainline, so at end it mess up the dtb!
There is an option to ask Marvell bootloader to not modify the dts, I think it is something like
ftd_skip.
Thank you for this pointer, setting fdt_skip_update no did fix this issue indeed.
That only leaves my second patch as needed, so I'll submit just that separately.
Patrick
Quoted 124 lines
Gregory
Quoted 105 lines
We had a regression based on the USB device probing, but that should be fixed now with the patch below. Do you have that?
Arnd
commit
7222c832254a75dcd67d683df75753d4a4e125bbAuthor: Nicolai Stange <[email protected]> Date: Thu Mar 17 23:53:02 2016 +0100usb/core: usb_alloc_dev(): fix setting of ->portnum With commit 69bec7259853 ("USB: core: let USB device know device node"), the port1 argument of usb_alloc_dev() gets overwritten as follows: ... usb_alloc_dev(..., unsigned port1) { ... if (!parent->parent) { port1 = usb_hcd_find_raw_port_number(..., port1); } ... } Later on, this now overwritten port1 gets assigned to ->portnum: dev->portnum = port1; However, since xhci_find_raw_port_number() isn't idempotent, the aforementioned commit causes a number of KASAN splats like the following: BUG: KASAN: slab-out-of-bounds in xhci_find_raw_port_number+0x98/0x170 at addr ffff8801d9311670 Read of size 8 by task kworker/2:1/87 [...] Workqueue: usb_hub_wq hub_event 0000000000000188 000000005814b877 ffff8800cba17588 ffffffff8191447e 0000000041b58ab3 ffffffff82a03209 ffffffff819143a2 ffffffff82a252f4 ffff8801d93115e0 0000000000000188 ffff8801d9311628 ffff8800cba17588 Call Trace: [<ffffffff8191447e>] dump_stack+0xdc/0x15e [<ffffffff819143a2>] ? _atomic_dec_and_lock+0xa2/0xa2 [<ffffffff814e2cd1>] ? print_section+0x61/0xb0 [<ffffffff814e4939>] print_trailer+0x179/0x2c0 [<ffffffff814f0d84>] object_err+0x34/0x40 [<ffffffff814f4388>] kasan_report_error+0x2f8/0x8b0 [<ffffffff814eb91e>] ? __slab_alloc+0x5e/0x90 [<ffffffff812178c0>] ? __lock_is_held+0x90/0x130 [<ffffffff814f5091>] kasan_report+0x71/0xa0 [<ffffffff814ec082>] ? kmem_cache_alloc_trace+0x212/0x560 [<ffffffff81d99468>] ? xhci_find_raw_port_number+0x98/0x170 [<ffffffff814f33d4>] __asan_load8+0x64/0x70 [<ffffffff81d99468>] xhci_find_raw_port_number+0x98/0x170 [<ffffffff81db0105>] xhci_setup_addressable_virt_dev+0x235/0xa10 [<ffffffff81d9ea51>] xhci_setup_device+0x3c1/0x1430 [<ffffffff8121cddd>] ? trace_hardirqs_on+0xd/0x10 [<ffffffff81d9fac0>] ? xhci_setup_device+0x1430/0x1430 [<ffffffff81d9fad3>] xhci_address_device+0x13/0x20 [<ffffffff81d2081a>] hub_port_init+0x55a/0x1550 [<ffffffff81d28705>] hub_event+0xef5/0x24d0 [<ffffffff81d27810>] ? hub_port_debounce+0x2f0/0x2f0 [<ffffffff8195e1ee>] ? debug_object_deactivate+0x1be/0x270 [<ffffffff81210203>] ? print_rt_rq+0x53/0x2d0 [<ffffffff8121657d>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff8226acfb>] ? _raw_spin_unlock_irqrestore+0x5b/0x60 [<ffffffff81250000>] ? irq_domain_set_hwirq_and_chip+0x30/0xb0 [<ffffffff81256339>] ? debug_lockdep_rcu_enabled+0x39/0x40 [<ffffffff812178c0>] ? __lock_is_held+0x90/0x130 [<ffffffff81196877>] process_one_work+0x567/0xec0 [...] Afterwards, xhci reports some functional errors: xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion code 0x11. xhci_hcd 0000:00:14.0: ERROR: unexpected setup address command completion code 0x11. usb 4-3: device not accepting address 2, error -22 Fix this by not overwriting the port1 argument in usb_alloc_dev(), but storing the raw port number as required by OF in an additional variable, raw_port. Fixes: 69bec7259853 ("USB: core: let USB device know device node") Signed-off-by: Nicolai Stange <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>drivers/usb/core/usb.c +1
-0@@ -424,6 +424,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,struct usb_device *dev;struct usb_hcd *usb_hcd =bus_to_hcd (bus);unsigned root_hub =0 ; +unsigned raw_port = port1; dev =kzalloc (sizeof (*dev),GFP_KERNEL );if (!dev)@@ -498,11 +499,11 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,if (!parent->parent) {/* device under root hub's port */ drivers/usb/core/usb.c struct usb_device *usb_alloc_dev(struct usb_device *parent, · line 509
Quoted 10 lines
drivers/usb/core/usb.c +2
-2- port1 =usb_hcd_find_raw_port_number (usb_hcd, + raw_port =usb_hcd_find_raw_port_number (usb_hcd, port1); } dev->dev.of_node =usb_of_get_child_node (parent->dev.of_node, - port1); + raw_port);/* hub driver sets up TT records */ }--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
Hello,
Quoted 2 lines · Patrick Uiterwijk
Thank you for this pointer, setting
fdt_skip_updateno did fix this issue indeed.
Hum, what should fix the problem is to set fdt_skip_update to "yes". If you set it to "no", then the Marvell U-Boot will do its funky DTB tweaks which are not necessarily compatible with the mainline kernel DT bindings.
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
Hi,
Quoted 11 lines · Thomas Petazzoni
Hello,
Quoted 2 lines · Patrick Uiterwijk
Thank you for this pointer, setting
fdt_skip_updateno did fix this issue indeed.Hum, what should fix the problem is to set
fdt_skip_updateto "yes". If you set it to "no", then the Marvell U-Boot will do its funky DTB tweaks which are not necessarily compatible with the mainline kernel DT bindings.
Correct, I meant setting it to "yes" fixed the problem, sorry for the confusion.
Patrick
PATCH 1/2 ARM: mvebu: correct the usb node name from usb@ to ehci@
Hello,
Quoted 11 lines · Patrick Uiterwijk
Quoted 9 lines · Patrick Uiterwijk
Quoted 3 lines
Thank you for this pointer, setting
fdt_skip_updateno did fix this issue indeed.Hum, what should fix the problem is to set
fdt_skip_updateto "yes". If you set it to "no", then the Marvell U-Boot will do its funky DTB tweaks which are not necessarily compatible with the mainline kernel DT bindings.Correct, I meant setting it to "yes" fixed the problem, sorry for the confusion.
Ok, then it makes sense. It's amazing how much weird issues this Marvell U-Boot behavior has caused :-/
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 2/2 ARM: mvebu: Correct unit address for linksys
In reply to Patrick UiterwijkThe USB2 port for Armada 38x is defined to be at 58000, not at 50000.
--- arch/arm/boot/dts/armada-385-linksys.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-385-linksys.dtsi +1 -1
@@ -117,7 +117,7 @@ }; /* USB part of the eSATA/USB 2.0 port */ - ehci at 50000 { + ehci at 58000 { status = "okay"; };
Signature · 1 line
2.7.4