Linux USB
 help / color / mirror / Atom feed
From: Hanabishi <i.r.e.c.c.a.k.u.n+kernel.org@gmail.com>
To: Michal Pecio <michal.pecio@gmail.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Arisa Snowbell <arisa.snowbell@gmail.com>,
	linux-usb@vger.kernel.org, regressions@lists.linux.dev,
	Niklas Neronin <niklas.neronin@linux.intel.com>,
	Michal Kubecek <mkubecek@suse.cz>
Subject: Re: [PATCH v2 RFT] usb: xhci-pci: Fix USB2-only root hub registration
Date: Mon, 13 Oct 2025 14:33:13 +0000	[thread overview]
Message-ID: <b5cfef66-9324-40e9-bd35-3b456d627999@gmail.com> (raw)
In-Reply-To: <20251013100424.42d5b9d2.michal.pecio@gmail.com>

On 10/13/25 08:04, Michal Pecio wrote:
> A recent change to hide USB3 root hubs of USB2-only controllers broke
> registration of USB2 root hubs - allow_single_roothub is set too late,
> and by this time xhci_run() has already deferred root hub registration
> until after the shared HCD is added, which will never happen.
> 
> This makes such controllers unusable, but testers didn't notice since
> they were only bothered by warnings about empty USB3 root hubs. The bug
> causes problems to other people who actually use such HCs and I was
> able to confirm it on an ordinary HC by patching to ignore USB3 ports.
> 
> Setting allow_single_roothub during early setup fixes things.
> 
> Reported-by: Arisa Snowbell <arisa.snowbell@gmail.com>
> Closes: https://lore.kernel.org/linux-usb/CABpa4MA9unucCoKtSdzJyOLjHNVy+Cwgz5AnAxPkKw6vuox1Nw@mail.gmail.com/
> Reported-by: Michal Kubecek <mkubecek@suse.cz>
> Closes: https://lore.kernel.org/linux-usb/lnb5bum7dnzkn3fc7gq6hwigslebo7o4ccflcvsc3lvdgnu7el@fvqpobbdoapl/
> Fixes: 719de070f764 ("usb: xhci-pci: add support for hosts with zero USB3 ports")
> Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com>
> Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
> ---
> 
> New in v2:
> - don't set allow_single_roothub twice, it's harmless but lame
> - credit and Cc another reporter
> 
>   drivers/usb/host/xhci-pci.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 13454bef14d3..d292adc65e5a 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -588,6 +588,8 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
>   	if (!usb_hcd_is_primary_hcd(hcd))
>   		return 0;
>   
> +	xhci->allow_single_roothub = 1;
> +
>   	if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
>   		xhci_pme_acpi_rtd3_enable(pdev);
>   
> @@ -643,7 +645,6 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id)
>   	xhci = hcd_to_xhci(hcd);
>   	xhci->reset = reset;
>   
> -	xhci->allow_single_roothub = 1;
>   	if (!xhci_has_one_roothub(xhci)) {
>   		xhci->shared_hcd = usb_create_shared_hcd(&xhci_pci_hc_driver, &dev->dev,
>   							 pci_name(dev), hcd);

Hello. I just want to confirm that the patch works for me too.

Hadrware setup:

0d:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raphael/Granite Ridge USB 2.0 xHCI [1022:15b8]

6.18-rc1:

[    2.170519] xhci_hcd 0000:0d:00.0: xHCI Host Controller
[    2.170520] xhci_hcd 0000:0d:00.0: new USB bus registered, assigned bus number 7
[    2.171768] xhci_hcd 0000:0d:00.0: USB3 root hub has no ports
[    2.171783] xhci_hcd 0000:0d:00.0: hcc params 0x0110ffc5 hci version 0x120 quirks 0x0000000200000010
(usb port is not populated and does not work)

6.18-rc1 with the patch applied:

[    2.162897] xhci_hcd 0000:0d:00.0: xHCI Host Controller
[    2.162904] xhci_hcd 0000:0d:00.0: new USB bus registered, assigned bus number 7
[    2.164156] xhci_hcd 0000:0d:00.0: USB3 root hub has no ports
[    2.164171] xhci_hcd 0000:0d:00.0: hcc params 0x0110ffc5 hci version 0x120 quirks 0x0000000200000010
[    2.164356] usb usb7: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.18
[    2.164357] usb usb7: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.164358] usb usb7: Product: xHCI Host Controller
[    2.164358] usb usb7: Manufacturer: Linux 6.18.0-rc1 xhci-hcd
[    2.164359] usb usb7: SerialNumber: 0000:0d:00.0
[    2.164390] hub 7-0:1.0: USB hub found
[    2.164397] hub 7-0:1.0: 1 port detected
(usb port is populated and does work)


  parent reply	other threads:[~2025-10-13 14:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 20:47 [REGRESSION] USB-A devices not working on boot after recent USB merge Arisa Snowbell
2025-10-07 21:17 ` Michal Pecio
2025-10-07 22:30   ` Arisa Snowbell
2025-10-08  1:15     ` Arisa Snowbell
2025-10-08  1:41       ` Arisa Snowbell
2025-10-08  6:20       ` Michal Pecio
2025-10-08  9:02         ` Arisa Snowbell
2025-10-08 11:05           ` Michal Pecio
2025-10-08 12:16             ` Arisa Snowbell
2025-10-08 20:34               ` Michal Pecio
2025-10-08 21:29                 ` Arisa Snowbell
2025-10-08 22:25                   ` Arisa Snowbell
2025-10-09 11:14                     ` [REGRESSION] [REPRO] " Michal Pecio
2025-10-09 11:30                       ` Mathias Nyman
2025-10-09 13:27                         ` Michal Pecio
2025-10-10  8:15                           ` Mathias Nyman
2025-10-10  9:15                             ` Arisa Snowbell
2025-10-13  7:22                             ` [PATCH usb-next] usb: xhci-pci: Cleanup xhci_pci_setup() for shared HCD Michal Pecio
2025-10-13  7:55                               ` Mathias Nyman
2025-10-13  8:04                                 ` [PATCH v2 RFT] usb: xhci-pci: Fix USB2-only root hub registration Michal Pecio
2025-10-13 13:52                                   ` Arisa Snowbell
2025-10-13 14:33                                   ` Hanabishi [this message]
2025-10-13 16:03                                   ` Michal Kubecek
2025-11-14 14:06                                 ` [PATCH] usb: xhci-pci: Clean up xhci_pci_setup() Michal Pecio
2025-10-09 12:16                       ` [REGRESSION] [REPRO] USB-A devices not working on boot after recent USB merge Arisa Snowbell
2025-10-09 12:29                         ` [PATCH] usb: xhci-pci: Fix USB2-only root hub registration Michal Pecio
2025-10-09 12:49                           ` Arisa Snowbell
2025-10-09 13:08                             ` Mathias Nyman
2025-10-09 11:15                     ` [REGRESSION] USB-A devices not working on boot after recent USB merge 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=b5cfef66-9324-40e9-bd35-3b456d627999@gmail.com \
    --to=i.r.e.c.c.a.k.u.n+kernel.org@gmail.com \
    --cc=arisa.snowbell@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=michal.pecio@gmail.com \
    --cc=mkubecek@suse.cz \
    --cc=niklas.neronin@linux.intel.com \
    --cc=regressions@lists.linux.dev \
    /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