Re: [PATCH] usb: xhci: limit ports on the correct root hub
From: raoxu
Date: Thu Jun 04 2026 - 03:15:58 EST
On Thu, Jun 04, 2026 at 08:51:36AM +0200, Michal Pecio wrote:
> Previous patch for the same bug, Cc its author and bad commit author.
> https://lore.kernel.org/linux-usb/20260516033443.3646966-1-rollkingzzc@xxxxxxxxx/
>
> I'm not sure how people keep discovering this issue - only by review
> or are there really xHCI controllers with more than 31 USB 2.0 ports?
> Should things be patched to support them properly?
Thanks for pointing this out.
I missed Zhang's earlier patch. My patch was based on reviewing commit
9a7ad750a8fb ("usb: xhci: move roothub port limit validation").
Before that refactoring, the USB2 and USB3 root hub port limits were
applied to the corresponding root hub directly. After the validation was
moved into xhci_create_rhub_port_array(), the helper receives the root
hub being initialized, but the limit path still updates
xhci->usb3_rhub.num_ports unconditionally. That changes the original
logic when the helper is called for the USB2 root hub.
So this was found by code review of that refactoring, not from a real
controller with more than 31 USB 2.0 root hub ports.
Thanks,
Xu Rao