openwrtv4/target/linux
Thomas Reifferscheid 956e31b1e4 ipq8064: fix dwc3-of-simple module unloading for Netgear R7500
Without patch unloading the dwc3-of-simple module went stuck after
successfully removing hcd.1 during the hcd.0 removal:

root@LEDE:/# rmmod dwc3-of-simple
[   21.391846] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   21.391931] usb usb4: USB disconnect, device number 1
[   21.397038] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   21.401111] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   21.406685] usb usb3: USB disconnect, device number 1
[   21.412848] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   21.417248] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   21.422521] usb usb2: USB disconnect, device number 1
followed by nothing.

Sometimes a stall CPU was detected, or a kernel panic,
or a reboot occurred after a couple of minutes.

At the same time unloading the dwc3 module followed by dwc3-of-simple
module was working repeatedly.

root@LEDE:/# rmmod dwc3
[   53.827328] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   53.827412] usb usb4: USB disconnect, device number 1
[   53.832630] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   53.836452] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   53.842314] usb usb3: USB disconnect, device number 1
[   53.848412] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   53.852542] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   53.857882] usb usb2: USB disconnect, device number 1
[   53.863956] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   53.867875] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   53.873696] usb usb1: USB disconnect, device number 1
[   53.879742] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/# rmmod dwc3-of-simple
root@LEDE:/#

For the non-working case, the code was stuck in a readl() in
http://lxr.free-electrons.com/source/drivers/usb/host/xhci.c#L91
because
http://lxr.free-electrons.com/source/drivers/usb/dwc3/dwc3-of-simple.c#L126
was disabling the wrong clocks when removing hcd.1 (it was disabling
the clock of hcd.0). That's why the readl() went stuck when removing
hcd.0

The patch however addresses the clock assignment from the Netgear R7500
dts file and backs off the previous attempt.

Now unloading and repeated module loading is working just fine.

root@LEDE:/# rmmod dwc3-of-simple
[   24.089679] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   24.089765] usb usb4: USB disconnect, device number 1
[   24.094856] xhci-hcd xhci-hcd.1.auto: USB bus 4 deregistered
[   24.098963] xhci-hcd xhci-hcd.1.auto: remove, state 1
[   24.104522] usb usb3: USB disconnect, device number 1
[   24.111194] xhci-hcd xhci-hcd.1.auto: USB bus 3 deregistered
[   24.115086] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   24.120396] usb usb2: USB disconnect, device number 1
[   24.126503] xhci-hcd xhci-hcd.0.auto: USB bus 2 deregistered
[   24.130347] xhci-hcd xhci-hcd.0.auto: remove, state 1
[   24.135948] usb usb1: USB disconnect, device number 1
[   24.142085] xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
root@LEDE:/#

Fixes: dwc3-of-simple module unloading for Netgear R7500

Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
2017-04-24 09:20:23 +02:00
..
adm5120 adm5120: mark the rb1xx subtarget as broken 2017-01-16 20:40:12 +01:00
adm8668 build: fix subtarget descriptions 2016-09-04 13:35:11 +02:00
apm821xx apm821xx: remove 4.4 kernel support 2017-04-12 09:51:47 +02:00
ar7 ar7: diag.sh: use common status_led_* functions 2017-03-15 23:14:54 +01:00
ar71xx ar71xx: fix minor syntax error in /lib/upgrade/platform.sh 2017-04-22 18:58:44 +02:00
arc770 arc770: only calculate entry point address when necessary 2017-02-21 16:10:30 +01:00
archs38 archs38: only calculate entry point address when necessary 2017-02-21 16:10:32 +01:00
armvirt armvirt: merge arm64 as subtarget 64 2017-04-23 09:19:33 +08:00
at91 kernel: remove ubifs xz decompression support 2017-01-09 14:07:06 +01:00
ath25 kernel: backport MIPS changes introducing a separate IRQ stack 2017-01-15 18:25:54 +01:00
au1000 kernel: update kernel 3.18 to version 3.18.43 2016-10-24 20:25:14 +03:00
bcm53xx bcm53xx: enable Northstar thermal driver 2017-04-20 22:45:05 +02:00
brcm47xx kernel: update kernel 4.4 to 4.4.61 2017-04-15 18:26:41 +02:00
brcm63xx brcm63xx: diag.sh: use common status_led_blink_* functions 2017-03-15 23:15:19 +01:00
brcm2708 brcm2708: disable CONFIG_BCM2835_THERMAL by default 2017-04-15 08:24:42 +02:00
cns3xxx cns3xxx: enable mpcore watchdog 2017-04-12 12:13:16 +02:00
gemini gemini: rename config-default to config-4.4 2016-08-24 01:44:05 +03:00
generic kernel: use skb_cow_head() to deal with cloned skbs 2017-04-23 13:51:55 +02:00
imx6 kernel: update kernel 4.4 to 4.4.59 2017-04-02 12:48:00 +02:00
ipq806x ipq8064: fix dwc3-of-simple module unloading for Netgear R7500 2017-04-24 09:20:23 +02:00
ixp4xx kernel: update kernel 4.4 to 4.4.53 2017-03-12 15:46:02 +01:00
kirkwood kirkwood: fix include in etc/board.d/02_network 2017-02-28 23:46:02 +01:00
lantiq lantiq: improve DGN3500 LED definitions 2017-04-21 07:50:55 +02:00
layerscape kernel: update kernel 4.4 to 4.4.52 2017-03-03 18:17:47 +01:00
malta malta: restore "be" subtarget from being source-only 2017-03-05 16:34:17 +01:00
mcs814x kernel: remove kmod packages for bridge, stp, llc and 8021q 2017-02-09 14:49:34 +01:00
mediatek mediatek: various fixes for v4.9 2017-04-07 17:42:08 +02:00
mpc85xx kernel: remove DEVMEM/DEVKMEM platform overrides 2017-01-10 13:48:53 +01:00
mvebu Revert "mvebu: remove linux 4.4 support" 2017-04-17 08:44:37 +02:00
mxs mxs: enable nvmem support 2017-02-10 11:05:57 +01:00
octeon octeon: only copy sysupgrade file if present 2017-02-15 06:36:21 +01:00
omap omap: build various core drivers into the kernel instead of packaging them 2017-01-10 13:44:26 +01:00
omap24xx kernel: clean up usb gadget support 2016-09-15 13:11:21 +02:00
orion kernel: split up 980-arm_openwrt_machtypes.patch and move to target folders 2017-01-27 11:18:27 +01:00
oxnas oxnas: put u-boot images into image staging directory 2017-01-27 16:53:31 +01:00
pistachio kernel: update kernel 4.9 to 4.9.17 2017-03-26 12:23:19 +02:00
ppc40x build: fix subtarget descriptions 2016-09-04 13:35:11 +02:00
ppc44x ppc44x: mark as broken 2017-01-10 12:49:34 +01:00
ramips ramips: update DEVICE_PACKAGES for Ubiquiti EdgeRouter X 2017-04-22 18:55:22 +02:00
rb532 kernel: remove ubifs xz decompression support 2017-01-09 14:07:06 +01:00
sunxi build: get rid of host.mk 2017-02-26 13:31:44 +01:00
uml build: get rid of host.mk 2017-02-26 13:31:44 +01:00
x86 build: allow specifying flow-control to grub on serial console 2017-04-03 08:51:02 +02:00
xburst kernel: remove kmod packages for bridge, stp, llc and 8021q 2017-02-09 14:49:34 +01:00
zynq build: get rid of host.mk 2017-02-26 13:31:44 +01:00
Makefile