All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Fritz <chf.fritz@googlemail.com>
To: Xavier Drudis Ferran <xdrudis@tinet.cat>, u-boot@lists.denx.de
Cc: 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, 03 Mar 2023 10:42:20 +0100	[thread overview]
Message-ID: <5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com> (raw)
In-Reply-To: <Y/zvuN104P4w8nwE@xdrudis.tinet.cat>

>    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:

=> 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

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

=> 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

=> 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

=> 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.


  parent reply	other threads:[~2023-03-03  9:42 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 ` Christoph Fritz [this message]
2023-03-03 10:26   ` [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-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=5d158190ee4e5da9e34b377331da338af6223eef.camel@googlemail.com \
    --to=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 \
    --cc=xdrudis@tinet.cat \
    /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.