Skip to content

Commit ebca722

Browse files
author
Desnes Nunes
committed
usb: xhci: guarantee that IMAN register is flushed
JIRA: https://issues.redhat.com/browse/RHEL-116016 commit f5bce30 Author: Niklas Neronin <niklas.neronin@linux.intel.com> Date: Thu, 15 May 2025 16:56:13 +0300 Add read call to guarantee that the write to the IMAN register has been flushed. xHCI specification 1.2, section 5.5.2.1, Note: "Most systems have write buffers that minimize overhead, but this may require a read operation to guarantee that the write has been flushed from the posted buffer." Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20250515135621.335595-17-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 7c84df6 commit ebca722

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,6 +3087,9 @@ static void xhci_clear_interrupt_pending(struct xhci_interrupter *ir)
30873087
irq_pending = readl(&ir->ir_set->irq_pending);
30883088
irq_pending |= IMAN_IP;
30893089
writel(irq_pending, &ir->ir_set->irq_pending);
3090+
3091+
/* Read operation to guarantee the write has been flushed from posted buffers */
3092+
readl(&ir->ir_set->irq_pending);
30903093
}
30913094
}
30923095

drivers/usb/host/xhci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ int xhci_enable_interrupter(struct xhci_interrupter *ir)
335335
iman |= IMAN_IE;
336336
writel(iman, &ir->ir_set->irq_pending);
337337

338+
/* Read operation to guarantee the write has been flushed from posted buffers */
339+
readl(&ir->ir_set->irq_pending);
338340
return 0;
339341
}
340342

@@ -350,6 +352,7 @@ int xhci_disable_interrupter(struct xhci_interrupter *ir)
350352
iman &= ~IMAN_IE;
351353
writel(iman, &ir->ir_set->irq_pending);
352354

355+
readl(&ir->ir_set->irq_pending);
353356
return 0;
354357
}
355358

0 commit comments

Comments
 (0)