public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xhci: print warning when HCE was set
@ 2022-09-15  1:11 Longfang Liu
  2022-09-22 13:01 ` Mathias Nyman
  0 siblings, 1 reply; 7+ messages in thread
From: Longfang Liu @ 2022-09-15  1:11 UTC (permalink / raw)
  To: gregkh, mathias.nyman; +Cc: linux-usb, linux-kernel, yisen.zhuang, liulongfang

When HCE(Host Controller Error) is set, it means that the xhci hardware
controller has an error at this time, but the current xhci driver
software does not log this event.

By adding an HCE event detection in the xhci interrupt processing
interface, a warning log is output to the system, which is convenient
for system device status tracking.

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
---
 drivers/usb/host/xhci-ring.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index ad81e9a508b1..f6af479188e8 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3031,6 +3031,11 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
 	if (!(status & STS_EINT))
 		goto out;
 
+	if (status & STS_HCE) {
+		xhci_warn(xhci, "WARNING: Host Controller Error\n");
+		goto out;
+	}
+
 	if (status & STS_FATAL) {
 		xhci_warn(xhci, "WARNING: Host System Error\n");
 		xhci_halt(xhci);
-- 
2.33.0


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

end of thread, other threads:[~2022-12-09  6:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-15  1:11 [PATCH] xhci: print warning when HCE was set Longfang Liu
2022-09-22 13:01 ` Mathias Nyman
2022-09-24  2:35   ` liulongfang
2022-09-26  7:58     ` Mathias Nyman
2022-10-14  3:12       ` liulongfang
2022-10-14  7:56         ` Mathias Nyman
2022-12-09  6:13           ` liulongfang

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