My patch just fix set a correct bNbrPorts value for per XHCI controller, but 
this code modification is less. 
Yes, your advice having one descriptor per controller is more properly, this 
can solve all other potential problems. 












At 2026-06-28 04:10:13, "Marek Vasut" <[email protected]> wrote:
>On 6/27/26 2:37 PM, Beibei Yang wrote:
>> In a system with multiple XHCI controllers, the global descriptor.hub
>> (bNbrPorts) can be overwritten by a later initialized controller,
>> causing the root hub of an earlier controller to report wrong port
>> numbers.
>> 
>> Fix this by dynamically setting bNbrPorts from the current controller's
>> hcsparams1 in the USB_DT_HUB request handler, instead of relying on
>> a stale global value.
>
>How about having one descriptor per controller ?
>
>This is probably easily doable in xhci_lowlevel_init() with some 
>ctrl->hub_desc = kmemdup(descriptor.hub,...); and related tweaks.
>
>What do you think ?

Reply via email to