Skip to content

Commit 4e833c0

Browse files
Felipe BalbiSarah Sharp
Felipe Balbi
authored and
Sarah Sharp
committed
xhci: don't re-enable IE constantly
While we're at that, define IMAN bitfield to aid readability. The interrupt enable bit should be set once on driver init, and we shouldn't need to continually re-enable it. Commit c21599a introduced a read of the irq_pending register, and that allows us to preserve the state of the IE bit. Before that commit, we were blindly writing 0x3 to the register. This patch should be backported to kernels as old as 2.6.36, or ones that contain the commit c21599a "USB: xhci: Reduce reads and writes of interrupter registers". Signed-off-by: Felipe Balbi <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
1 parent a46c46a commit 4e833c0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/usb/host/xhci-ring.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,7 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
24172417
u32 irq_pending;
24182418
/* Acknowledge the PCI interrupt */
24192419
irq_pending = xhci_readl(xhci, &xhci->ir_set->irq_pending);
2420-
irq_pending |= 0x3;
2420+
irq_pending |= IMAN_IP;
24212421
xhci_writel(xhci, irq_pending, &xhci->ir_set->irq_pending);
24222422
}
24232423

drivers/usb/host/xhci.h

+4
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@ struct xhci_op_regs {
205205
#define CMD_PM_INDEX (1 << 11)
206206
/* bits 12:31 are reserved (and should be preserved on writes). */
207207

208+
/* IMAN - Interrupt Management Register */
209+
#define IMAN_IP (1 << 1)
210+
#define IMAN_IE (1 << 0)
211+
208212
/* USBSTS - USB status - status bitmasks */
209213
/* HC not running - set to 1 when run/stop bit is cleared. */
210214
#define STS_HALT XHCI_STS_HALT

0 commit comments

Comments
 (0)