Skip to content

Commit c57f9ac

Browse files
author
Desnes Nunes
committed
usb: xhci: rework Event Ring Segment Table Address mask
JIRA: https://issues.redhat.com/browse/RHEL-116016 commit 74d7a75 Author: Niklas Neronin <niklas.neronin@linux.intel.com> Date: Thu, 15 May 2025 16:56:16 +0300 Event Ring Segment Table Base Address Register contain two fields: - Bits 5:0: RsvdP (Reserved and Preserved) - Bits 63:6: Event Ring Segment Table Base Address Currently, an inverted RsvdP mask (ERST_BASE_RSVDP) is used to extract bits 63:6. Replaces the inverted mask with a non-inverted mask, 'ERST_BASE_ADDRESS_MASK', which makes the code easier to read. 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-20-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 8ba7087 commit c57f9ac

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/usb/host/xhci-mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,8 +2338,8 @@ void xhci_add_interrupter(struct xhci_hcd *xhci, unsigned int intr_num)
23382338
writel(erst_size, &ir->ir_set->erst_size);
23392339

23402340
erst_base = xhci_read_64(xhci, &ir->ir_set->erst_base);
2341-
erst_base &= ERST_BASE_RSVDP;
2342-
erst_base |= ir->erst.erst_dma_addr & ~ERST_BASE_RSVDP;
2341+
erst_base &= ~ERST_BASE_ADDRESS_MASK;
2342+
erst_base |= ir->erst.erst_dma_addr & ERST_BASE_ADDRESS_MASK;
23432343
if (xhci->quirks & XHCI_WRITE_64_HI_LO)
23442344
hi_lo_writeq(erst_base, &ir->ir_set->erst_base);
23452345
else

drivers/usb/host/xhci.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ struct xhci_intr_reg {
255255
#define ERST_SIZE_MASK (0xffff)
256256

257257
/* erst_base bitmasks */
258-
#define ERST_BASE_RSVDP (GENMASK_ULL(5, 0))
258+
/* bits 63:6 - Event Ring Segment Table Base Address Register */
259+
#define ERST_BASE_ADDRESS_MASK GENMASK_ULL(63, 6)
259260

260261
/* erst_dequeue bitmasks */
261262
/* Dequeue ERST Segment Index (DESI) - Segment number (or alias)

0 commit comments

Comments
 (0)