Commit 5bfc311d authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

usb: xhci: correct return value in case of STS_HCE

If we get STS_HCE we give up on the interrupt, but for the purpose
of IRQ handling that still counts as ours. We may return IRQ_NONE
only if we are positive that it wasn't ours. Hence correct the default.

Fixes: 2a25e66d ("xhci: print warning when HCE was set")
Cc: stable@vger.kernel.org # v6.2+
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240404121106.2842417-2-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 39cd87c4
...@@ -3133,7 +3133,7 @@ static int xhci_handle_events(struct xhci_hcd *xhci, struct xhci_interrupter *ir ...@@ -3133,7 +3133,7 @@ static int xhci_handle_events(struct xhci_hcd *xhci, struct xhci_interrupter *ir
irqreturn_t xhci_irq(struct usb_hcd *hcd) irqreturn_t xhci_irq(struct usb_hcd *hcd)
{ {
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_HANDLED;
u32 status; u32 status;
spin_lock(&xhci->lock); spin_lock(&xhci->lock);
...@@ -3141,12 +3141,13 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) ...@@ -3141,12 +3141,13 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
status = readl(&xhci->op_regs->status); status = readl(&xhci->op_regs->status);
if (status == ~(u32)0) { if (status == ~(u32)0) {
xhci_hc_died(xhci); xhci_hc_died(xhci);
ret = IRQ_HANDLED;
goto out; goto out;
} }
if (!(status & STS_EINT)) if (!(status & STS_EINT)) {
ret = IRQ_NONE;
goto out; goto out;
}
if (status & STS_HCE) { if (status & STS_HCE) {
xhci_warn(xhci, "WARNING: Host Controller Error\n"); xhci_warn(xhci, "WARNING: Host Controller Error\n");
...@@ -3156,7 +3157,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) ...@@ -3156,7 +3157,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
if (status & STS_FATAL) { if (status & STS_FATAL) {
xhci_warn(xhci, "WARNING: Host System Error\n"); xhci_warn(xhci, "WARNING: Host System Error\n");
xhci_halt(xhci); xhci_halt(xhci);
ret = IRQ_HANDLED;
goto out; goto out;
} }
...@@ -3167,7 +3167,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) ...@@ -3167,7 +3167,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
*/ */
status |= STS_EINT; status |= STS_EINT;
writel(status, &xhci->op_regs->status); writel(status, &xhci->op_regs->status);
ret = IRQ_HANDLED;
/* This is the handler of the primary interrupter */ /* This is the handler of the primary interrupter */
xhci_handle_events(xhci, xhci->interrupters[0]); xhci_handle_events(xhci, xhci->interrupters[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment