From: Heiner Kallweit <hkallweit1@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linux USB Mailing List <linux-usb@vger.kernel.org>,
"open list:ARM/Amlogic Meson..."
<linux-amlogic@lists.infradead.org>
Subject: Re: [PATCH] usb: core: improve handling of hubs with no ports
Date: Wed, 23 Feb 2022 13:26:23 +0100 [thread overview]
Message-ID: <4701f080-ef18-dbb2-7dd9-d9171a73411f@gmail.com> (raw)
In-Reply-To: <YhWXgyJ4lk8OpT57@rowland.harvard.edu>
On 23.02.2022 03:10, Alan Stern wrote:
> On Tue, Feb 22, 2022 at 10:13:09PM +0100, Heiner Kallweit wrote:
>> I get the "hub doesn't have any ports" error message on a system with
>> Amlogic S905W SoC. Seems the SoC has internal USB 3.0 supports but
>> is crippled with regard to USB 3.0 ports.
>> Maybe we shouldn't consider this scenario an error. So let's change
>> the message to info level, but otherwise keep the handling of the
>> scenario as it is today. With the patch it looks like this on my
>> system.
>>
>> dwc2 c9100000.usb: supply vusb_d not found, using dummy regulator
>> dwc2 c9100000.usb: supply vusb_a not found, using dummy regulator
>> dwc2 c9100000.usb: EPs: 7, dedicated fifos, 712 entries in SPRAM
>> xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
>> xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
>> xhci-hcd xhci-hcd.0.auto: hcc params 0x0228f664 hci version 0x100 quirks 0x0000000002010010
>> xhci-hcd xhci-hcd.0.auto: irq 49, io mem 0xc9000000
>> hub 1-0:1.0: USB hub found
>> hub 1-0:1.0: 2 ports detected
>> xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
>> xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
>> xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
>> usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
>> hub 2-0:1.0: USB hub found
>> hub 2-0:1.0: hub has no ports, exiting
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> drivers/usb/core/hub.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
>> index 83b5aff25..e3f40d1f4 100644
>> --- a/drivers/usb/core/hub.c
>> +++ b/drivers/usb/core/hub.c
>> @@ -1423,9 +1423,8 @@ static int hub_configure(struct usb_hub *hub,
>> ret = -ENODEV;
>> goto fail;
>> } else if (hub->descriptor->bNbrPorts == 0) {
>> - message = "hub doesn't have any ports!";
>> - ret = -ENODEV;
>> - goto fail;
>> + dev_info(hub_dev, "hub has no ports, exiting\n");
>> + return -ENODEV;
>> }
>>
>> /*
>
> How about instead changing xhci-hcd so that it doesn't try to register
> a USB-3 root hub if the controller doesn't have any USB-3 ports? I
> think that would make more sense.
>
Right, this would be better. I checked and it seems to be a little bit
bigger endeavor. If I let register_root_hub() fail, then this removes
the USB3 bus/host (shared hcd), but also the USB2 bus/host.
It took an additional change to xhci_plat_probe() to make it work on my
system. Not sure what the impact could be on systems not using
xhci_plat_probe(). Users may face the same issue like me, and having
a USB3 hub with no ports may remove also the USB2 bus/host.
What I can do: submit my patches as RFC, then there's a better basis
for a discussion.
> Alan Stern
Heiner
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2022-02-23 12:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 21:13 [PATCH] usb: core: improve handling of hubs with no ports Heiner Kallweit
2022-02-23 2:10 ` Alan Stern
2022-02-23 12:26 ` Heiner Kallweit [this message]
2022-02-23 14:17 ` Alan Stern
2022-02-23 14:58 ` Heiner Kallweit
2022-02-23 15:37 ` Alan Stern
2022-02-23 20:58 ` Heiner Kallweit
2022-02-23 22:13 ` Alan Stern
2022-02-24 20:06 ` Jack Pham
2022-02-24 20:16 ` Heiner Kallweit
2022-02-24 20:21 ` Alan Stern
2022-03-03 11:50 ` Mathias Nyman
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=4701f080-ef18-dbb2-7dd9-d9171a73411f@gmail.com \
--to=hkallweit1@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).