From: Michal Pecio <michal.pecio@gmail.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
"Xuetao (kirin)" <xuetao09@huawei.com>,
caiyadong@huawei.com, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] usb: core: Fix root hub descriptor wBytesPerInterval
Date: Wed, 6 May 2026 12:31:55 +0200 [thread overview]
Message-ID: <20260506123155.3b041e55.michal.pecio@gmail.com> (raw)
In-Reply-To: <a7d9e9f2-4752-469f-b7e4-f0db11852e6f@linux.intel.com>
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?
Regards,
Michal
next prev parent reply other threads:[~2026-05-06 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 9:13 [PATCH v2 1/3] usb: core: Fix root hub descriptor wBytesPerInterval Michal Pecio
2026-05-04 9:16 ` [PATCH v2 2/3] usb: core: Fix up Interrupt IN endpoints with bogus wBytesPerInterval Michal Pecio
2026-05-04 9:17 ` [PATCH v2 3/3] usb: core: Clean up SuperSpeed/eUSB2 descriptor validation logging Michal Pecio
2026-05-06 10:17 ` [PATCH v2 1/3] usb: core: Fix root hub descriptor wBytesPerInterval Mathias Nyman
2026-05-06 10:31 ` Michal Pecio [this message]
2026-05-06 10:44 ` 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=20260506123155.3b041e55.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=caiyadong@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=stern@rowland.harvard.edu \
--cc=xuetao09@huawei.com \
/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