All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xavier Drudis Ferran <xdrudis@tinet.cat>
To: Christoph Fritz <chf.fritz@googlemail.com>
Cc: Xavier Drudis Ferran <xdrudis@tinet.cat>,
	u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Kever Yang <kever.yang@rock-chips.com>,
	Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>, Marek Vasut <marex@denx.de>
Subject: Re: [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2.
Date: Fri, 3 Mar 2023 11:26:45 +0100	[thread overview]
Message-ID: <ZAHLZWp/cBPP9ZMz@xdrudis.tinet.cat> (raw)
In-Reply-To: <5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com>

El Fri, Mar 03, 2023 at 10:42:20AM +0100, Christoph Fritz deia:
> >    Changes:
> > 
> >    v5: fixes a bug that Christoph Fritz discovered, consisting in the
> >        wrong eror code returned when enabling or disabling the clock
> >        because property_enable() returns an error code in linux but
> >        the modified register value in U-Boot. This caused the clk
> >        disable to abort before freeing the clock and it apparently
> >        left things bad enough to cause a hang or a reset.
> > 
> 
> With your patches ontop of v2023.04-rc2, xhci works now fine on a
> rk3399 board:
>

Fine, thanks a lot for testing. I thought the problem was with EHCI.

> Totally unrelated to your patches, stopping usb still crashes (with or
> without your patch) but only when a USB-Ethernet-Dongle (+HUB) is
> connected:
>

Well, but with v4 you got a couple more messages about devices not
removed but children gone. With v5 those messages don't show any
more. So v5 fixes one of the bugs you were seeing, more bugs remain.

Unfortunately I don't think I have any usb-ethernet dongle here to test...

> => usb start
> starting USB...
> do_usb_start, 581
> Bus usb@fe380000: USB EHCI 1.00
> Bus usb@fe3c0000: USB EHCI 1.00
> Bus usb@fe800000: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.10
> Bus usb@fe900000: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.10
> scanning bus usb@fe380000 for devices... 3 USB Device(s) found
> scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found
> scanning bus usb@fe800000 for devices... 1 USB Device(s) found
> scanning bus usb@fe900000 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
> => usb tree
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>   |  u-boot EHCI Host Controller
>   |
>   +-2  Hub (480 Mb/s, 100mA)
>     |   USB2.0 Hub
>     |
>     +-3  Human Interface (12 Mb/s, 400mA)
>          ILITEK ILITEK-TP
> 
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller
> 
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
> 
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
>

Ok, so this was with a keyboard or something connected to a USB 2 port
and nothing in the blue USB 3 port, right?

> => usb stop
> stopping USB..
> => usb start
> starting USB...
> Bus usb@fe380000: USB EHCI 1.00
> Bus usb@fe3c0000: USB EHCI 1.00
> Bus usb@fe800000: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.10
> Bus usb@fe900000: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.10
> scanning bus usb@fe380000 for devices... 4 USB Device(s) found
> scanning bus usb@fe3c0000 for devices... 1 USB Device(s) found
> scanning bus usb@fe800000 for devices... 3 USB Device(s) found
> scanning bus usb@fe900000 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
> => usb tree
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>   |  u-boot EHCI Host Controller
>   |
>   +-2  Hub (480 Mb/s, 100mA)
>     |   USB2.0 Hub
>     |
>     +-3  Hub (480 Mb/s, 0mA)
>     |    VIA Labs, Inc.          USB2.0 Hub
>     |
>     +-4  Human Interface (12 Mb/s, 400mA)
>          ILITEK ILITEK-TP
> 
>   1  Hub (480 Mb/s, 0mA)
>      u-boot EHCI Host Controller
> 
>   1  Hub (5 Gb/s, 0mA)
>   |  U-Boot XHCI Host Controller
>   |
>   +-2  Hub (5 Gb/s, 0mA)
>     |  VIA Labs, Inc.          USB3.0 Hub
>     |
>     +-3  Vendor specific (5 Gb/s, 36mA)
>          Realtek USB 10/100/1000 LAN 00E04C68034E
> 
>   1  Hub (5 Gb/s, 0mA)
>      U-Boot XHCI Host Controller
>

And this was with the keyboard in USB2 and a USB3 VIA Labs hub
connected to the USB3 port and a Realtek ethernet-USB dongle attached
to that USB3 hub, right?


> => usb stop
> stopping USB..
> <hangs here forever>
> 
> I just quirked/masked the underlying issue by not doing usb_stop() at
> all in drivers/usb/host/usb-uclass.c.
> 

Does usb reset also hang ? If so the problem then must be that you are
left with no way to rescan for devices that were not connected at usb
start but get connected later ?

Did you say before it all worked if you unconfigured EHCI and worked
with XHCI only? (or OHCI + XHCI but no EHCI). Might it have to do with
the same hub hanging from the EHCI and XHCI controller? (but it doesn't
sound strange to me, the hub doesn't know what devices will be
connected to it...)

If you leave drivers/usb/host/usb-uclass.c as it was but drop some
#define DEBUG in device-remove.c does it give any hint ? 

I'll try to do some more tests with a USB3 hub and usb storage...

Thanks again for testing.

  reply	other threads:[~2023-03-03 10:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 18:00 [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2 Xavier Drudis Ferran
2023-02-27 18:05 ` [PATCH v5 1/2] " Xavier Drudis Ferran
2023-02-27 18:10 ` [PATCH 2/2] arm: rk3399: usb2phy: phy-rockchip-inno-usb2.c: Implement operations for the 480MHz usb2phy clock in rk3399 Xavier Drudis Ferran
2023-03-03  9:42 ` [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2 Christoph Fritz
2023-03-03 10:26   ` Xavier Drudis Ferran [this message]
2023-03-03 17:47     ` can't reproduce XHCI hang in Rock Pi 4 Xavier Drudis Ferran
2023-06-02  6:41     ` [PATCH v5 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2 Jagan Teki
2023-06-02  9:24       ` [SPAM] " Xavier Drudis Ferran
2023-06-02 10:04         ` Jagan Teki
2023-06-03  7:23           ` Xavier Drudis Ferran
2023-06-04  8:22             ` Xavier Drudis Ferran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAHLZWp/cBPP9ZMz@xdrudis.tinet.cat \
    --to=xdrudis@tinet.cat \
    --cc=chf.fritz@googlemail.com \
    --cc=kever.yang@rock-chips.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=philipp.tomsich@vrull.eu \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.