mbox series

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

Message ID 0684616b-5cc0-e9f6-7015-ce709c6d4386@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 16, 2022, 10:08 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.

Follow-up to this series could be applying the xhci-plat extension
to other xhci drivers.

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

v2:
- reordered patches
- create new helper xhci_has_one_roothub() instead of using
  xhci_hcd->needs_shared_hcd (proposed by Mathias)

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

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

Comments

Mathias Nyman March 24, 2022, 9:23 a.m. UTC | #1
On 17.3.2022 0.08, 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.
> 
> Follow-up to this series could be applying the xhci-plat extension
> to other xhci drivers.
> 

Thanks,
Patches look good but something must have changed since you submitted them.
I can't apply them neatly on usb-next, usb-linus, 5.17, or 5.17-rc8


On top of usb-next I get:
Applying: usb: host: xhci-plat: create shared hcd after having added main hcd
error: patch failed: drivers/usb/host/xhci-plat.c:313
error: drivers/usb/host/xhci-plat.c: patch does not apply
Patch failed at 0003 usb: host: xhci-plat: create shared hcd after having added main hcd

-Mathias
Heiner Kallweit March 24, 2022, 7:38 p.m. UTC | #2
On 24.03.2022 10:23, Mathias Nyman wrote:
> On 17.3.2022 0.08, 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.
>>
>> Follow-up to this series could be applying the xhci-plat extension
>> to other xhci drivers.
>>
> 
> Thanks,
> Patches look good but something must have changed since you submitted them.
> I can't apply them neatly on usb-next, usb-linus, 5.17, or 5.17-rc8
> 
> 
> On top of usb-next I get:
> Applying: usb: host: xhci-plat: create shared hcd after having added main hcd
> error: patch failed: drivers/usb/host/xhci-plat.c:313
> error: drivers/usb/host/xhci-plat.c: patch does not apply
> Patch failed at 0003 usb: host: xhci-plat: create shared hcd after having added main hcd
> 
The series was based on linux-next. Seems you're missing 8e10548f7f48
("Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720"").

> -Mathias

Heiner
Mathias Nyman March 24, 2022, 8:46 p.m. UTC | #3
On 24.3.2022 21.38, Heiner Kallweit wrote:
> On 24.03.2022 10:23, Mathias Nyman wrote:
>> On 17.3.2022 0.08, 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.
>>>
>>> Follow-up to this series could be applying the xhci-plat extension
>>> to other xhci drivers.
>>>
>>
>> Thanks,
>> Patches look good but something must have changed since you submitted them.
>> I can't apply them neatly on usb-next, usb-linus, 5.17, or 5.17-rc8
>>
>>
>> On top of usb-next I get:
>> Applying: usb: host: xhci-plat: create shared hcd after having added main hcd
>> error: patch failed: drivers/usb/host/xhci-plat.c:313
>> error: drivers/usb/host/xhci-plat.c: patch does not apply
>> Patch failed at 0003 usb: host: xhci-plat: create shared hcd after having added main hcd
>>
> The series was based on linux-next. Seems you're missing 8e10548f7f48
> ("Revert "usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720"").
> 
>> -Mathias
> 
> Heiner
> 

Thanks, applies fine on linux-next.

I'll add these after 5.18-rc1 to my own tree, and try them out by faking a one roothub
PCI xhci device. Patches should end up in 5.19 if all goes well.

-Mathias