From: Michal Pecio <michal.pecio@gmail.com>
To: 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>
Subject: [PATCH usb-next] usb: xhci-pci: Cleanup xhci_pci_setup() for shared HCD
Date: Mon, 13 Oct 2025 09:22:50 +0200 [thread overview]
Message-ID: <20251013092250.699bf60f.michal.pecio@gmail.com> (raw)
In-Reply-To: <b8c2423f-aa9d-442a-ae2f-3c4d78949b38@linux.intel.com>
This function will be called again when/if the shared HCD is added.
Little to do in this case and there is no need to set some de-facto
read-only properties of the xhci again, even if it was harmless.
Don't bother passing the unused xhci_pci_quirks in this case either.
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
---
This is an alternative to the cleanup discussed last week, which
doesn't require a v2 bugfix. But I also have a v2 bugfix ready if
you think the original option was better.
Both variants were tested with and without "fake USB2-only" patch.
The idea here is that there will hopefully never be anything PCI
specific to do with the shared HCD, so make it patently clear.
It is actually more likely that xhci_gen_setup() might try to use
allow_single_roothub or imod_interval, in which case this version
avoids creating another surprise like the one last week.
drivers/usb/host/xhci-pci.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index cb7f5dd34333..e09f5fb52cf3 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -568,7 +568,7 @@ static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { }
static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) { }
#endif /* CONFIG_ACPI */
-/* called during probe() after chip reset completes */
+/* called during probe() after chip reset completes and again on the shared HCD */
static int xhci_pci_setup(struct usb_hcd *hcd)
{
struct xhci_hcd *xhci;
@@ -576,6 +576,10 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
int retval;
u8 sbrn;
+ /* nothing PCI-specific for the shared HCD, just core setup, no quirks */
+ if (!usb_hcd_is_primary_hcd(hcd))
+ return xhci_gen_setup(hcd, NULL);
+
xhci = hcd_to_xhci(hcd);
/* imod_interval is the interrupt moderation value in nanoseconds. */
@@ -586,9 +590,6 @@ static int xhci_pci_setup(struct usb_hcd *hcd)
if (retval)
return retval;
- if (!usb_hcd_is_primary_hcd(hcd))
- return 0;
-
if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
xhci_pme_acpi_rtd3_enable(pdev);
--
2.48.1
next prev parent reply other threads:[~2025-10-13 7:22 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 ` Michal Pecio [this message]
2025-10-13 7:55 ` [PATCH usb-next] usb: xhci-pci: Cleanup xhci_pci_setup() for shared HCD 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
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=20251013092250.699bf60f.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=arisa.snowbell@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--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