public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Michal Pecio <michal.pecio@gmail.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 13:44:06 +0300	[thread overview]
Message-ID: <b0a0ab5e-cfba-4854-900b-4c575c3b74f0@linux.intel.com> (raw)
In-Reply-To: <20260506123155.3b041e55.michal.pecio@gmail.com>

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



      reply	other threads:[~2026-05-06 10:44 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
2026-05-06 10:44     ` Mathias Nyman [this message]

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=b0a0ab5e-cfba-4854-900b-4c575c3b74f0@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=caiyadong@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.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