From: Michal Pecio <michal.pecio@gmail.com>
To: "Xuetao (kirin)" <xuetao09@huawei.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Alan Stern <stern@rowland.harvard.edu>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<caiyadong@huawei.com>, <stable@kernel.org>
Subject: [PATCH 1/2] usb: core: Fix root hub descriptor wBytesPerInterval
Date: Thu, 23 Apr 2026 11:06:48 +0200 [thread overview]
Message-ID: <20260423110648.158ec861.michal.pecio@gmail.com> (raw)
In-Reply-To: <20260423110517.664745da.michal.pecio@gmail.com>
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.
This is inconsequential for emulated root hubs, but we may want to
override and log suspiciously low wBytesPerInterval in descriptors,
so fix this to prevent nuisance warnings.
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
---
drivers/usb/core/hcd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 89221f1ce769..fc8130f94ca5 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -339,7 +339,8 @@ static const u8 ss_rh_config_descriptor[] = {
/* Companion */
0x00, /* __u8 ss_bMaxBurst; allows 1 TX between ACKs */
0x00, /* __u8 ss_bmAttributes; 1 packet per service interval */
- 0x02, 0x00 /* __le16 ss_wBytesPerInterval; 15 bits for max 15 ports */
+ /* __le16 ss_wBytesPerInterval; same as wMaxPacketSize */
+ (USB_MAXCHILDREN + 1 + 7) / 8, 0x00,
};
/* authorized_default behaviour:
--
2.48.1
next prev parent reply other threads:[~2026-04-23 9:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 2:14 [PATCH] usb: core: Fix bandwidth for devices with invalid wBytesPerInterval Tao Xue
2026-04-02 2:45 ` Alan Stern
2026-04-02 3:51 ` Greg KH
2026-04-02 6:59 ` Xuetao (kirin)
2026-04-02 7:10 ` Greg KH
2026-04-02 8:26 ` Xuetao (kirin)
2026-04-02 13:56 ` Alan Stern
2026-04-02 14:09 ` Greg KH
2026-04-02 15:03 ` Michal Pecio
2026-04-03 1:20 ` Xuetao (kirin)
2026-04-22 13:26 ` Xuetao (kirin)
2026-04-23 9:05 ` Michal Pecio
2026-04-23 9:06 ` Michal Pecio [this message]
2026-04-23 9:09 ` [PATCH 2/2] usb: core: Fix up Interrupt IN endpoints with bogus wBytesPerInterval Michal Pecio
2026-04-23 14:04 ` Alan Stern
2026-04-23 14:55 ` Xuetao (kirin)
2026-04-02 20:17 ` [PATCH] usb: core: Fix bandwidth for devices with invalid wBytesPerInterval Michal Pecio
2026-04-02 9:44 ` Michal Pecio
2026-04-02 11:55 ` Xuetao (kirin)
2026-04-03 7:16 ` Michal Pecio
2026-04-22 6:32 ` Michal Pecio
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=20260423110648.158ec861.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=stable@kernel.org \
--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