Skip to content

Commit 5bfc311

Browse files
oneukumgregkh
authored andcommitted
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: 2a25e66 ("xhci: print warning when HCE was set") Cc: [email protected] # v6.2+ Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 39cd87c commit 5bfc311

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3133,20 +3133,21 @@ static int xhci_handle_events(struct xhci_hcd *xhci, struct xhci_interrupter *ir
31333133
irqreturn_t xhci_irq(struct usb_hcd *hcd)
31343134
{
31353135
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
3136-
irqreturn_t ret = IRQ_NONE;
3136+
irqreturn_t ret = IRQ_HANDLED;
31373137
u32 status;
31383138

31393139
spin_lock(&xhci->lock);
31403140
/* Check if the xHC generated the interrupt, or the irq is shared */
31413141
status = readl(&xhci->op_regs->status);
31423142
if (status == ~(u32)0) {
31433143
xhci_hc_died(xhci);
3144-
ret = IRQ_HANDLED;
31453144
goto out;
31463145
}
31473146

3148-
if (!(status & STS_EINT))
3147+
if (!(status & STS_EINT)) {
3148+
ret = IRQ_NONE;
31493149
goto out;
3150+
}
31503151

31513152
if (status & STS_HCE) {
31523153
xhci_warn(xhci, "WARNING: Host Controller Error\n");
@@ -3156,7 +3157,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
31563157
if (status & STS_FATAL) {
31573158
xhci_warn(xhci, "WARNING: Host System Error\n");
31583159
xhci_halt(xhci);
3159-
ret = IRQ_HANDLED;
31603160
goto out;
31613161
}
31623162

@@ -3167,7 +3167,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
31673167
*/
31683168
status |= STS_EINT;
31693169
writel(status, &xhci->op_regs->status);
3170-
ret = IRQ_HANDLED;
31713170

31723171
/* This is the handler of the primary interrupter */
31733172
xhci_handle_events(xhci, xhci->interrupters[0]);

0 commit comments

Comments
 (0)