On Mon, Apr 07, 2014 at 09:04:41AM +0000, Amund Hov wrote:
> 
> >>> The USB bus specification says that 255 devices can be connected to the
> >>> host, but that doesn't mean the xHCI host controller has all the
> >>> internal resources to support that.
> >
> > To me that sounds like such xHCI HCs can not be considered USB compliant. :\
> 
> I would tend to agree Peter. It sounds weird that the number of connected 
> devices would
>  not be part of the  USB standard. On the other hand it makes sense as a host 
> controller
> on a small tablet wouldn’t need to handle more than a few devices. Still, 
> would be nice to
> have this in more clear print in resources online which frequently quote the 
> 127 number
> with reservations made on bandwidth, not hardware registers.
> 
> I realise this might not be relevant to kernel development at this point,
> so I’ll take my ranting elsewhere.

I completely understand your frustration, and it actually is relevant to
kernel development. :)  Perhaps the attached patch would have at least
saved you some time and frustration in debugging the driver and host
issue?

Sarah Sharp

>8-------------------------------------------------------------------8<

xHCI host controllers may only support a limited number of device slot
IDs, which is usually far less than the theoretical maximum number of
devices (255) that the USB specifications advertise.  This is
frustrating to consumers that expect to be able to plug in a large
number of devices.

Add a print statement when the Enable Slot command fails to show how
many devices the host supports.  We can't change hardware manufacturer's
design decisions, but hopefully we can save customers a little bit of
time trying to debug why their host mysteriously fails when too many
devices are plugged in.

Signed-off-by: Sarah Sharp <sarah.a.sh...@linux.intel.com>
Reported-by: Amund Hov <amund....@silabs.com>
---
 drivers/usb/host/xhci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 26dffd4e6d73..421a3a2c4509 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3668,6 +3668,9 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device 
*udev)
 
        if (!xhci->slot_id) {
                xhci_err(xhci, "Error while assigning device slot ID\n");
+               xhci_err(xhci, "Max number of devices this xHCI host supports 
is %u.\n",
+                               HCS_MAX_SLOTS(
+                                       readl(&xhci->cap_regs->hcs_params1)));
                return 0;
        }
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to