Re: [PATCH v1 0/6] arm64: qcom: sa8775p: add support for USB

Adrien Thierry
2023-04-27T17:25:22Z

Hi Konrad,

On Thu, Apr 27, 2023 at 12:42:15AM +0100, Konrad Dybcio wrote:
>
> On 4/24/23 23:35, Adrien Thierry wrote:
> > Hi Shazad,
> >
> > On Fri, Apr 21, 2023 at 07:09:15PM +0530, Shazad Hussain wrote:
> > > Update relavent DT bindings for USB, add new config to the phy driver,
> > > add USB and PHY nodes to the .dtsi and enable them in the board .dts
> > > for the sa8775p-ride platform.
> > >
> > > Shazad Hussain (6):
> > > dt-bindings: usb: qcom,dwc3: Add bindings for SA8775P
> > > dt-bindings: phy: qcom,usb-snps-femto-v2: Add bindings for SA8775P
> > > dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add SA8775P USB PHY
> > > binding
> > > phy: qcom-qmp: Add SA8775P USB3 UNI phy
> > > arm64: dts: qcom: sa8775p: add USB nodes
> > > arm64: dts: qcom: sa8775p-ride: enable USB nodes
> > >
> > > .../phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml | 1 +
> > > .../bindings/phy/qcom,usb-snps-femto-v2.yaml | 1 +
> > > .../devicetree/bindings/usb/qcom,dwc3.yaml | 5 +
> > > arch/arm64/boot/dts/qcom/sa8775p-ride.dts | 92 +++++++
> > > arch/arm64/boot/dts/qcom/sa8775p.dtsi | 239 +++++++++++++++++-
> > > drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 45 ++++
> > > 6 files changed, 381 insertions(+), 2 deletions(-)
> > >
> > > --
> > > 2.17.1
> > >
> > Thanks for posting this. I tested the series on the sa8775p, and it seems
> > initialization for the controller at a400000 sometimes fails with a
> > timeout (-110) error:
> >
> > dwc3 a400000.usb: Adding to iommu group 2
> > xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
> > xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
> > xhci-hcd xhci-hcd.0.auto: can't setup: -110
> > xhci-hcd xhci-hcd.0.auto: USB bus 1 deregistered
> > xhci-hcd: probe of xhci-hcd.0.auto failed with error -110
> > dwc3 a600000.usb: Adding to iommu group 3
> > dwc3 a800000.usb: Adding to iommu group 4
> > xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
> > xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
> > xhci-hcd xhci-hcd.1.auto: hcc params 0x0110ffc5 hci version 0x110 quirks 0x0000000000010010
> > xhci-hcd xhci-hcd.1.auto: irq 162, io mem 0x0a800000
> > xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
> > xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
> > xhci-hcd xhci-hcd.1.auto: Host supports USB 3.1 Enhanced SuperSpeed
> > hub 1-0:1.0: USB hub found
> > hub 1-0:1.0: 1 port detected
> > usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
> > hub 2-0:1.0: USB hub found
> > hub 2-0:1.0: 1 port detected
> >
> > In this case, only usb devices for a800000 are showing:
> >
> > dracut:/# ls -alh /sys/bus/usb/devices
> > total 0
> > drwxr-xr-x 2 root root 0 Feb 27 00:00 .
> > drwxr-xr-x 4 root root 0 Feb 27 00:00 ..
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 1-0:1.0 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.1.auto/usb1/1-0:1.0
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 2-0:1.0 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.1.auto/usb2/2-0:1.0
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 usb1 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.1.auto/usb1
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 usb2 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.1.auto/usb2
> >
> > This happens approximately 1 out of 2 reboots. Here's the kernel output
> > when initialization succeeds:
> >
> > dwc3 a600000.usb: Adding to iommu group 2
> > dwc3 a800000.usb: Adding to iommu group 3
> > xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
> > xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
> > xhci-hcd xhci-hcd.0.auto: hcc params 0x0110ffc5 hci version 0x110 quirks 0x0000000000010010
> > xhci-hcd xhci-hcd.0.auto: irq 161, io mem 0x0a800000
> > xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
> > xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
> > xhci-hcd xhci-hcd.0.auto: Host supports USB 3.1 Enhanced SuperSpeed
> > hub 1-0:1.0: USB hub found
> > hub 1-0:1.0: 1 port detected
> > usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
> > hub 2-0:1.0: USB hub found
> > hub 2-0:1.0: 1 port detected
> > dwc3 a400000.usb: Adding to iommu group 4
> > xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
> > xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 3
> > xhci-hcd xhci-hcd.1.auto: USB3 root hub has no ports
> > xhci-hcd xhci-hcd.1.auto: hcc params 0x0220fe65 hci version 0x110 quirks 0x0000000000010010
> > xhci-hcd xhci-hcd.1.auto: irq 162, io mem 0x0a400000
> > hub 3-0:1.0: USB hub found
> > hub 3-0:1.0: 1 port detected
> >
> > And the list of usb devices:
> >
> > dracut:/# ls -alh /sys/bus/usb/devices
> > total 0
> > drwxr-xr-x 2 root root 0 Feb 27 00:00 .
> > drwxr-xr-x 4 root root 0 Feb 27 00:00 ..
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 1-0:1.0 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.0.auto/usb1/1-0:1.0
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 2-0:1.0 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.0.auto/usb2/2-0:1.0
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 3-0:1.0 -> ../../../devices/platform/soc@0/a4f8800.usb/a400000.usb/xhci-hcd.1.auto/usb3/3-0:1.0
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 usb1 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.0.auto/usb1
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 usb2 -> ../../../devices/platform/soc@0/a8f8800.usb/a800000.usb/xhci-hcd.0.auto/usb2
> > lrwxrwxrwx 1 root root 0 Feb 27 00:00 usb3 -> ../../../devices/platform/soc@0/a4f8800.usb/a400000.usb/xhci-hcd.1.auto/usb3
> >
> > Have you also encountered this?
>
> I've had some issues with QMPPHY not (sometimes?) probing in time on SM6115 only when built as a module.. perhaps it'd be worth checking out of it works fine with =y?

Looks like that might be the cause indeed. The arm64 defconfig has the
PHYs built as modules, but with either CONFIG_PHY_QCOM_QMP_USB=y or
CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2=y, the controllers initialize properly
all the time.

So, the series is:

Tested-by: Adrien Thierry <athierry@redhat.com>

>
>
> Konrad
>
> >
> > Best,
> >
> > Adrien
> >