"hub doesn't have any ports" error message on the disabled USB addressable root hub port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
In our latest ARM64-based CPU, we use the DesignWare USB which is
xHCI-compatible. For some reasons, we disable USB3.0 support so remove the
unnecessary USB3.0 capability structure information as specified in the
xHCI specification 1.1, section 7.2:
"At least one of these capability structures is required for all xHCI
implementations. More than one may be defined for implementations that
support more that one bus protocol."

When booting kernel, linux kernel displays an error message to claim about
no USB port on the USB3.0 roothub:
[    3.497767] hub 2-0:1.0: config failed, hub doesn't have any ports!
(err -19)
Although the error message does not affect USB functionality, error
message will make users confused.

Looking into the XHCI driver, there are always two USB hub ports
implemented. This implements the xHCI specification as in 4.19.7:
"In a USB3 hub, two independently addressable hub ports exist for each
physical down stream connector; a USB2 compatible port accessed through
the USB2 connection and a USB3 compatible port accessed through the
SuperSpeed connection. The Root Hub of the xHCI emulates this operation by
defining a Root Hub PORTSC register for each connection type; USB2
(Low-/Full-/High-Speed) or USB3 (SuperSpeed)."

But the problem is that, xhci-hcd always pass both USB hub ports to
usb-core driver. In case any of USB2 or USB3 compatible port is missing,
there is no port on the corresponding hub and kernel will displays the
error message.

Below are some approaches we suggest to overcome the issue:
Approach 1: Allow roothub has no port. The change will look like:
	diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
	index b5c7336..995d62d 100644
	--- a/drivers/usb/core/hub.c
	+++ b/drivers/usb/core/hub.c
	@@ -1347,6 +1347,9 @@ static int hub_configure(struct usb_hub
*hub,
					ret = -ENODEV;
					goto fail;
			} else if (hub->descriptor->bNbrPorts == 0) {
	+               if (hdev->parent)
	+                       return -ENODEV;
	+
					message = "hub doesn't have any
ports!";
					ret = -ENODEV;
					goto fail;
Approach 2: do not pass a USB hub port to usb-core if it has no port.
Don't know if this approach is feasible or not.
Approach 3: implement maximum-speed attribute support and this will be set
to high-speed in case of missing USB3 support. But this works only for the
case of USB3.0 disabled.

Can you help review and suggest what approach should be used to fix this
issue?

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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux