Skip to content

Commit eb0f691

Browse files
oneukumSasha Levin
authored andcommitted
usb: xhci: correct return value in case of STS_HCE
[ Upstream commit 5bfc311 ] 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: stable@vger.kernel.org # v6.2+ Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20240404121106.2842417-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 5c00785 commit eb0f691

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
@@ -3123,20 +3123,21 @@ static int xhci_handle_events(struct xhci_hcd *xhci, struct xhci_interrupter *ir
31233123
irqreturn_t xhci_irq(struct usb_hcd *hcd)
31243124
{
31253125
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
3126-
irqreturn_t ret = IRQ_NONE;
3126+
irqreturn_t ret = IRQ_HANDLED;
31273127
u32 status;
31283128

31293129
spin_lock(&xhci->lock);
31303130
/* Check if the xHC generated the interrupt, or the irq is shared */
31313131
status = readl(&xhci->op_regs->status);
31323132
if (status == ~(u32)0) {
31333133
xhci_hc_died(xhci);
3134-
ret = IRQ_HANDLED;
31353134
goto out;
31363135
}
31373136

3138-
if (!(status & STS_EINT))
3137+
if (!(status & STS_EINT)) {
3138+
ret = IRQ_NONE;
31393139
goto out;
3140+
}
31403141

31413142
if (status & STS_HCE) {
31423143
xhci_warn(xhci, "WARNING: Host Controller Error\n");
@@ -3146,7 +3147,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
31463147
if (status & STS_FATAL) {
31473148
xhci_warn(xhci, "WARNING: Host System Error\n");
31483149
xhci_halt(xhci);
3149-
ret = IRQ_HANDLED;
31503150
goto out;
31513151
}
31523152

@@ -3157,7 +3157,6 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
31573157
*/
31583158
status |= STS_EINT;
31593159
writel(status, &xhci->op_regs->status);
3160-
ret = IRQ_HANDLED;
31613160

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

0 commit comments

Comments
 (0)