Picking commit from QSDK
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=eggplant&id=a86bda9f8a7965f0cedd347a9c04800eb9f41ea3
Commit message:
"During removal of the glue layer(dwc3-of-simple), USB master reset is set to active and during insertion it is de-activated."
Change-Id: I537dc810f6cb2a46664ee674840145066432b957
Signed-off-by: Vasudevan Murugesan <vmuruges@codeaurora.org>
(cherry picked from commit 4611e13580a216812f85f0801b95442d02eeb836)"
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
According to QSDK and OEM tarballs (checked c2600, r7500v2, r7800) 2nd pci slot (pci1, 2,4 GHz card)) on ap148 based boards should operate in gen1 mode.
EA8500 is an exception and according to GPL pcie0 should operate in gen1 mode.
In previous commit we've added the support for this option, so enable it in DT for affected devices.
QSDK ref:
https://source.codeaurora.org/quic/qsdk/oss/kernel/linux-msm/commit/?h=release/endive_preview_cc&id=f3b07fe309027c52fc163149500cedddd707c506
While at it move the phy transmit termination offset value into dtsi file as it's platform specific.
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
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>
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 .dtsi
file. Most probably it went into openwrt here:
https://dev.openwrt.org/browser/trunk/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch?rev=45261
copied from Qualcomms attempt here: https://lkml.org/lkml/2015/11/20/116
Now unloading and repeated module loading is working just fine,
no matter if you'd remove dwc3-of-simple or dwc3.
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
Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
Makes use of the syscon tcsr and enables both USB ports. Cleans up
qcom-ipq8064.dtsi from previous attempts.
Fixes FS#497
Signed-off-by: Thomas Reifferscheid <thomas@reifferscheid.org>
Current driver shows temp in full degrees while other apps await it
to be in millidegrees.
Initially the driver represents termal data in millidegrees but then
it gets divided by TSENS_FACTOR. So lets just set it to '1'.
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
At the moment as a workaround definition for scm firmware in DT is used as if it is
apq8064 board. This leads to incomplete scm firmware initialization and as a result
cpuidle driver fails to configure.
By design unlike other qcom boards ipq do not use clocks to connect to scm.
Considering this we're removing from DT and scm driver clocks for ipq boards.
As a result cpuidle does not produce errors about failed configuration anymore.
Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Do not patch upstream files, overwrite them entirely. The upstream files
are buggy for a number of devices and this significantly simplifies the
patch structure
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: John Crispin <john@phrozen.org>