[Letux-kernel] Letux-5.16-rc8 on PinePhone (Developer edition)

H. Nikolaus Schaller hns at goldelico.com
Fri Jan 7 22:04:29 CET 2022

Hi Andreas,

> Am 07.01.2022 um 16:32 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> Am 07.01.2022 um 10:56 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> I did do some manual bisect and found that letux-5.10(.0) has working usb gadget
>> while letux-5.10.y (=.89) fails. So a real bisect should be able to find it.
> Manual bisect shows that letux-5.10.19 works while letux-5.10.20 fails.
> No downstream change by us...
> Now trying to bisect between.
> This means roughly:
> git checkout -B test letux-5.10.20
> git rebase letux-5.10.19
> git bisect start test letux-5.10.19
> (well it is more difficult since letux-5.10.19 is just a tag and doesn't compile without two additional patches).

Ok, here is the culprit:

iMac:master hns$ git bisect bad
e420a3443a7f95453e112291fb026c6a1d3e7255 is the first bad commit
commit e420a3443a7f95453e112291fb026c6a1d3e7255
Author: Andre Przywara <andre.przywara at arm.com>
Date:   Wed Jan 13 15:26:23 2021 +0000

    arm64: dts: allwinner: A64: properly connect USB PHY to port 0
    [ Upstream commit cc72570747e43335f4933a24dd74d5653639176a ]
    In recent Allwinner SoCs the first USB host controller (HCI0) shares
    the first PHY with the MUSB controller. Probably to make this sharing
    work, we were avoiding to declare this in the DT. This has two
    - U-Boot (which uses the same .dts) cannot use this port in host mode
      without a PHY linked, so we were loosing one USB port there.
    - It requires the MUSB driver to be enabled and loaded, although we
      don't actually use it.
    To avoid those issues, let's add this PHY link to the A64 .dtsi file.
    After all PHY port 0 *is* connected to HCI0, so we should describe
    it as this. Remove the part from the Pinebook DTS which already had
    this property.
    This makes it work in U-Boot, also improves compatiblity when no MUSB
    driver is loaded (for instance in distribution installers).
    Fixes: dc03a047df1d ("arm64: allwinner: a64: add EHCI0/OHCI0 nodes to A64 DTSI")
    Signed-off-by: Andre Przywara <andre.przywara at arm.com>
    Acked-by: Chen-Yu Tsai <wens at csie.org>
    Signed-off-by: Maxime Ripard <maxime at cerno.tech>
    Link: https://lore.kernel.org/r/20210113152630.28810-2-andre.przywara@arm.com
    Signed-off-by: Sasha Levin <sashal at kernel.org>

 arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 4 ----
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi         | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
iMac:master hns$ 

iMac:master hns$ git show cc72570747e43335f4933a24dd74d5653639176a
commit cc72570747e43335f4933a24dd74d5653639176a
Author: Andre Przywara <andre.przywara at arm.com>

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
index 896f34fd9fc3..d07cf05549c3 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts
@@ -126,8 +126,6 @@ &de {
 &ehci0 {
-       phys = <&usbphy 0>;
-       phy-names = "usb";
        status = "okay";
@@ -177,8 +175,6 @@ &mmc2 {
 &ohci0 {
-       phys = <&usbphy 0>;
-       phy-names = "usb";
        status = "okay";
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 51cc30e84e26..19e9b8ca8432 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -593,6 +593,8 @@ ehci0: usb at 1c1a000 {
                                 <&ccu CLK_USB_OHCI0>;
                        resets = <&ccu RST_BUS_OHCI0>,
                                 <&ccu RST_BUS_EHCI0>;
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
                        status = "disabled";
@@ -603,6 +605,8 @@ ohci0: usb at 1c1a400 {
                        clocks = <&ccu CLK_BUS_OHCI0>,
                                 <&ccu CLK_USB_OHCI0>;
                        resets = <&ccu RST_BUS_OHCI0>;
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
                        status = "disabled";
iMac:master hns$ 

Well, we build for MUSB into the kernel (so we don't see in lsmod):

iMac:master hns$ fgrep MUSB .config
# MUSB DMA mode
iMac:master hns$ 

Strange is also the comment "although we don't actually use it".

Maybe, after this patch we have to actively disable CONFIG_USB_MUSB_SUNXI?

Hm. Ist this A64 generic or specific for the PinePhone?
Should it be fixed in arch/arm64/configs/letux_defconfig?
or should we revert the above definition of phys just for the PinePhone?

Well, if I change to 


it is NOT loaded.

So this indicates something else: with the patch we maybe
have to configure some other driver (the one for usbphy?).

Or something completely different:

[    0.187482] sun4i-usb-phy 1c19400.phy: failed to get clock usb0_phy


More information about the Letux-kernel mailing list