mbox series

[0/5] usb: host: xhci-plat: omit shared hcd if either of the root hubs has no ports

Message ID 18a93669-7f7a-dad8-38f4-44819fc3b64a@gmail.com (mailing list archive)
Headers show
Series usb: host: xhci-plat: omit shared hcd if either of the root hubs has no ports | expand

Message

Heiner Kallweit March 4, 2022, 6:32 p.m. UTC
I have a system with a low-cost Amlogic S905W SoC that supports USB3
but has a USB3 root hub with no ports. This results in an error
message and a hcd that is good for nothing. The USB2 root hub has
ports and works normally.
I think we can do better and omit creating a shared hcd if either of
the root hubs has no ports. This series is based on discussion [0].

The series works as intended for me. What I couldn't test is the case
of the USB2 root hub having no ports.

[0] https://www.spinics.net/lists/linux-usb/msg223416.html

Heiner Kallweit (5):
  usb: host: xhci-plat: create shared hcd after having added main hcd
  xhci: factor out parts of xhci_gen_setup()
  xhci: prepare for operation w/o shared hcd
  usb: host: xhci-plat: prepare operation w/o shared hcd
  xhci: support omitting shared hcd if either of the root hubs has no ports

 drivers/usb/host/xhci-hub.c  |   3 +-
 drivers/usb/host/xhci-mem.c  |  11 +--
 drivers/usb/host/xhci-plat.c |  43 ++++++----
 drivers/usb/host/xhci.c      | 155 ++++++++++++++++++++---------------
 drivers/usb/host/xhci.h      |  20 +++++
 5 files changed, 140 insertions(+), 92 deletions(-)

Comments

Mathias Nyman March 8, 2022, 2:31 p.m. UTC | #1
On 4.3.2022 20.32, Heiner Kallweit wrote:
> I have a system with a low-cost Amlogic S905W SoC that supports USB3
> but has a USB3 root hub with no ports. This results in an error
> message and a hcd that is good for nothing. The USB2 root hub has
> ports and works normally.
> I think we can do better and omit creating a shared hcd if either of
> the root hubs has no ports. This series is based on discussion [0].
> 
> The series works as intended for me. What I couldn't test is the case
> of the USB2 root hub having no ports.
> 
> [0] https://www.spinics.net/lists/linux-usb/msg223416.html
> 

Thanks for the series. Big picture looks good.

Some minor concerns, for example how the generic xhci code now assumes
we can start the controller (run) after adding the primary hcd if only
one roothub has ports, and assumes the secondary hcd won't be added.

After this series this is true for controllers using xhci-plat.c,
but not for mediatek, tegra and all PCI xhci controllers.
I'll comment that patch with more info.

I'll see if I can try to fake a pci xhci controller to try this series out.

Thanks
-Mathias