Skip to content

Commit 8ba7087

Browse files
author
Desnes Nunes
committed
usb: xhci: rework Event Ring Segment Table Size mask
JIRA: https://issues.redhat.com/browse/RHEL-116016 commit 7c6df26 Author: Niklas Neronin <niklas.neronin@linux.intel.com> Date: Thu, 15 May 2025 16:56:15 +0300 Event Ring Segment Table Size Register contain two fields: - Bits 15:0: Event Ring Segment Table Size - Bits 31:16: RsvdZ (Reserved and Zero) The current mask 'ERST_SIZE_MASK' refers to the RsvdZ bits (31:16). Change the mask to refer to bits 15:0, which are the Event Ring Segment Table Size bits. 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-19-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Desnes Nunes <desnesn@redhat.com>
1 parent 3c1b210 commit 8ba7087

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/usb/host/xhci-mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,7 @@ xhci_remove_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
18311831
*/
18321832
if (ir->ir_set) {
18331833
tmp = readl(&ir->ir_set->erst_size);
1834-
tmp &= ERST_SIZE_MASK;
1834+
tmp &= ~ERST_SIZE_MASK;
18351835
writel(tmp, &ir->ir_set->erst_size);
18361836

18371837
xhci_update_erst_dequeue(xhci, ir, true);
@@ -2333,7 +2333,7 @@ void xhci_add_interrupter(struct xhci_hcd *xhci, unsigned int intr_num)
23332333

23342334
/* set ERST count with the number of entries in the segment table */
23352335
erst_size = readl(&ir->ir_set->erst_size);
2336-
erst_size &= ERST_SIZE_MASK;
2336+
erst_size &= ~ERST_SIZE_MASK;
23372337
erst_size |= ir->event_ring->num_segs;
23382338
writel(erst_size, &ir->ir_set->erst_size);
23392339

drivers/usb/host/xhci.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ struct xhci_intr_reg {
251251
#define ER_IRQ_COUNTER_MASK (0xffff << 16)
252252

253253
/* erst_size bitmasks */
254-
/* Preserve bits 16:31 of erst_size */
255-
#define ERST_SIZE_MASK (0xffff << 16)
254+
/* bits 15:0 - Event Ring Segment Table Size, number of ERST entries */
255+
#define ERST_SIZE_MASK (0xffff)
256256

257257
/* erst_base bitmasks */
258258
#define ERST_BASE_RSVDP (GENMASK_ULL(5, 0))

0 commit comments

Comments
 (0)