All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] xhci: Reset TI usb controller on xhci shutdown
@ 2026-10-14 22:28 wenxiong
  2026-10-14 22:38 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: wenxiong @ 2026-10-14 22:28 UTC (permalink / raw)
  To: mathias.nyman, gregkh
  Cc: linux-usb, linux-kernel, stable, wenxiong, Wen Xiong

From: Wen Xiong <wenxiong@linux.ibm.com>

Fixes kexec boot. Without a hard reset, TI pci usb chips will fail to
initialize in a kexec booted kernel.

Signed-off-by: Wen Xixong <wenxiong@linux.ibm.com>
---
 drivers/usb/host/xhci-pci.c | 11 ++++++++++-
 drivers/usb/host/xhci.h     |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index a8889081ae82..36191639bf43 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -479,8 +479,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	    pdev->device == PCI_DEVICE_ID_ASMEDIA_3042_XHCI)
 		xhci->quirks |= XHCI_RESET_ON_RESUME;
 
-	if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
+	if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) {
 		xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
+		xhci->quirks |= XHCI_RESET_ON_SHUTDOWN;
+	}
 
 	if ((pdev->vendor == PCI_VENDOR_ID_BROADCOM ||
 	     pdev->vendor == PCI_VENDOR_ID_CAVIUM) &&
@@ -950,6 +952,13 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
 	/* Yet another workaround for spurious wakeups at shutdown with HSW */
 	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
 		pci_set_power_state(pdev, PCI_D3hot);
+
+	/* 
+	* TI xHCI controllers fail to initialize in a kexec 
+	* kernel without a PCI function reset
+	*/
+	if (xhci->quirks & XHCI_RESET_ON_SHUTDOWN)
+		pci_reset_function_locked(pdev);
 }
 
 /*-------------------------------------------------------------------------*/
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index c7bfa7f028d3..e94a38e5f4ac 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1647,6 +1647,7 @@ struct xhci_hcd {
 #define XHCI_CDNS_SCTX_QUIRK	BIT_ULL(48)
 #define XHCI_ETRON_HOST	BIT_ULL(49)
 #define XHCI_LIMIT_ENDPOINT_INTERVAL_9 BIT_ULL(50)
+#define XHCI_RESET_ON_SHUTDOWN	BIT_ULL(51)
 
 	unsigned int		num_active_eps;
 	unsigned int		limit_active_eps;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] xhci: Reset TI usb controller on xhci shutdown
  2026-10-14 22:28 [PATCH V2] xhci: Reset TI usb controller on xhci shutdown wenxiong
@ 2026-10-14 22:38 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-14 22:38 UTC (permalink / raw)
  To: wenxiong; +Cc: linux-usb

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] usb: xhci: typo in commit signature and comment formatting
--

commit d01818bc6cd938fdc83cd4a8bea9dbde80b9d813
Author: Wen Xiong <wenxiong@linux.ibm.com>

xhci: Reset TI usb controller on xhci shutdown

This commit introduces a PCI function reset on shutdown for TI xHCI
controllers to ensure they initialize properly in a kexec booted kernel.

> Signed-off-by: Wen Xixong <wenxiong@linux.ibm.com>

[Severity: Low]
This isn't a bug, but there is a typo in the Signed-off-by name (Xixong
instead of Xiong).

> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index a8889081ae824..36191639bf430 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c

[ ... ]

> @@ -950,6 +952,13 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
>  	/* Yet another workaround for spurious wakeups at shutdown with HSW */
>  	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
>  		pci_set_power_state(pdev, PCI_D3hot);
> +
> +	/* 
> +	* TI xHCI controllers fail to initialize in a kexec 
> +	* kernel without a PCI function reset
> +	*/

[Severity: Low]
This isn't a bug, but is this block comment introduced in xhci_pci_shutdown
missing the standard leading spaces before the asterisks on the second and
third lines?

> +	if (xhci->quirks & XHCI_RESET_ON_SHUTDOWN)
> +		pci_reset_function_locked(pdev);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014222855.13698-1-wenxiong@linux.ibm.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-14 22:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 22:28 [PATCH V2] xhci: Reset TI usb controller on xhci shutdown wenxiong
2026-10-14 22:38 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.