public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: xhci: add xhci_halt() for HCE Handling
@ 2026-01-27 11:04 jiangdayu
  2026-01-27 11:22 ` Greg Kroah-Hartman
  2026-01-27 12:25 ` Mathias Nyman
  0 siblings, 2 replies; 16+ messages in thread
From: jiangdayu @ 2026-01-27 11:04 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman
  Cc: Longfang Liu, linux-usb, linux-kernel, yudongbin, guhuinan,
	chenyu45, mahongwei3, jiangdayu

When the xHCI controller reports a Host Controller Error (HCE) status
in the interrupt handler, the driver currently only logs a warning and
continues execution. However, a Host Controller Error indicates a
critical hardware failure that requires the controller to be halted.

Add xhci_halt(xhci) call after the HCE warning to properly halt the
controller when this error condition is detected. This ensures the
controller is in a consistent state and prevents further operations
on a failed hardware. Additionally, if there are still unhandled
interrupts at this point, it may cause interrupt storm.

The change is made in xhci_irq() function where STS_HCE status is
checked, mirroring the existing error handling pattern used for
STS_FATAL errors.

Fixes: 2a25e66d676df ("xhci: print warning when HCE was set")
Signed-off-by: jiangdayu <jiangdayu@xiaomi.com>
---
 drivers/usb/host/xhci-ring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 9315ba18310d..1cbefee3c4ca 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3195,6 +3195,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
 
 	if (status & STS_HCE) {
 		xhci_warn(xhci, "WARNING: Host Controller Error\n");
+		xhci_halt(xhci);
 		goto out;
 	}
 
-- 
2.34.1


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

end of thread, other threads:[~2026-02-28  0:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 11:04 [PATCH] usb: xhci: add xhci_halt() for HCE Handling jiangdayu
2026-01-27 11:22 ` Greg Kroah-Hartman
2026-01-28  8:48   ` Dayu Jiang
2026-01-28  8:56     ` Greg Kroah-Hartman
2026-02-26  9:27       ` Dayu Jiang
2026-02-26 16:44         ` Mathias Nyman
2026-02-26 18:17           ` Thinh Nguyen
2026-02-27  7:26             ` Dayu Jiang
2026-02-28  0:22               ` Thinh Nguyen
2026-02-27  9:43             ` Mathias Nyman
2026-02-27 11:05               ` Michal Pecio
2026-02-28  0:06                 ` Thinh Nguyen
2026-02-28  0:18               ` Thinh Nguyen
2026-02-27  7:33           ` Dayu Jiang
2026-01-27 12:25 ` Mathias Nyman
2026-01-28  8:53   ` Dayu Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox