Re: [PATCH v2 1/3] usb: core: Fix root hub descriptor wBytesPerInterval

From: Mathias Nyman

Date: Wed May 06 2026 - 06:45:52 EST


On 5/6/26 13:31, Michal Pecio wrote:
On Wed, 6 May 2026 13:17:46 +0300, Mathias Nyman wrote:
On 5/4/26 12:13, Michal Pecio wrote:
Per USB3 9.6.7, it's "the total number of bytes this endpoint will
transfer every service interval". There seems to be no good reason
to have wBytesPerInterval < wMaxPacketSize - either one is too low
or the other too high. Here, wBytesPerInterval is too low for hubs
with more than 15 ports and xHCI spec allows such root hubs.

There shouldn't be a USB3 hub with more than 15 ports as
USB 3.x specification limits USB3 ports to 15.

See USB 3.2 section 10.15.2.1 Hub Descriptor
"bNbrPorts: Number of downstream facing ports that this hub supports. The
maximum number of ports of ports a hub can support is 15."


Hub driver also fails if hub has more than 15 ports.
hub.c hub_configure():

maxchild = USB_MAXCHILDREN;
if (hub_is_superspeed(hdev))
maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS);

if (hub->descriptor->bNbrPorts > maxchild) {
message = "hub has too many ports!";
ret = -ENODEV;
goto fail;

ch11.h:#define USB_SS_MAXPORTS 15

The USB 3.2 specification 10.15.1 'Standard Descriptors for Hub Class' also
shows hardcoded values of '2' for both the wBytesPerInterval and wMaxPacketSize
for the hub interrupt endpoint.

Thanks, looks like we should be able to get away with reducing
wMaxPacketSize then. Currently it's calculated to fit USB_MAXCHILDREN
i.e. 31 ports, supposedly dictated by the needs of (obsolete) WUSB.

Any preferences whether to replace USB_MAXCHILDREN with USB_SS_MAXPORTS
in the existing formula for USB3 hubs or just hardcode 0x02?

Maybe prefer the hardcoded 0x02 value as spec does it as well

Thanks
Mathias