Skip to content

Commit f27c6da

Browse files
Epicuriusgregkh
authored andcommitted
usb: xhci: rename 'irq_control' to 'imod'
The Interrupt Register Set contains Interrupt Moderation register (IMOD). The IMOD register contains the following fields: - Bits 15:0: Interrupt Moderation Interval (IMODI) - Bits 31:16: Interrupt Moderation Counter (IMODC) In the xHCI driver, the pointer currently named 'irq_control' refers to the IMOD register. However, the name 'irq_control' does not accurately describe the register or its contents, and the xHCI specification does not use the term "irq control" or "interrupt control" for this register. To improve clarity and better align with the xHCI specification, the pointer is renamed to 'imod'. Additionally, the IMOD register fields IMODI & IMODC have their own masks, which are also renamed for consistency: * 'ER_IRQ_INTERVAL_MASK' -> 'IMODI_MASK' * 'ER_IRQ_COUNTER_MASK' -> 'IMODC_MASK' 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-23-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bf9cce9 commit f27c6da

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

drivers/usb/host/xhci.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@ int xhci_set_interrupter_moderation(struct xhci_interrupter *ir,
367367
return -EINVAL;
368368

369369
/* IMODI value in IMOD register is in 250ns increments */
370-
imod_interval = umin(imod_interval / 250, ER_IRQ_INTERVAL_MASK);
370+
imod_interval = umin(imod_interval / 250, IMODI_MASK);
371371

372-
imod = readl(&ir->ir_set->irq_control);
373-
imod &= ~ER_IRQ_INTERVAL_MASK;
372+
imod = readl(&ir->ir_set->imod);
373+
imod &= ~IMODI_MASK;
374374
imod |= imod_interval;
375-
writel(imod, &ir->ir_set->irq_control);
375+
writel(imod, &ir->ir_set->imod);
376376

377377
return 0;
378378
}
@@ -835,7 +835,7 @@ static void xhci_save_registers(struct xhci_hcd *xhci)
835835
ir->s3_erst_base = xhci_read_64(xhci, &ir->ir_set->erst_base);
836836
ir->s3_erst_dequeue = xhci_read_64(xhci, &ir->ir_set->erst_dequeue);
837837
ir->s3_iman = readl(&ir->ir_set->iman);
838-
ir->s3_irq_control = readl(&ir->ir_set->irq_control);
838+
ir->s3_imod = readl(&ir->ir_set->imod);
839839
}
840840
}
841841

@@ -859,7 +859,7 @@ static void xhci_restore_registers(struct xhci_hcd *xhci)
859859
xhci_write_64(xhci, ir->s3_erst_base, &ir->ir_set->erst_base);
860860
xhci_write_64(xhci, ir->s3_erst_dequeue, &ir->ir_set->erst_dequeue);
861861
writel(ir->s3_iman, &ir->ir_set->iman);
862-
writel(ir->s3_irq_control, &ir->ir_set->irq_control);
862+
writel(ir->s3_imod, &ir->ir_set->imod);
863863
}
864864
}
865865

drivers/usb/host/xhci.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ struct xhci_op_regs {
213213
* struct xhci_intr_reg - Interrupt Register Set, v1.2 section 5.5.2.
214214
* @iman: IMAN - Interrupt Management Register. Used to enable
215215
* interrupts and check for pending interrupts.
216-
* @irq_control: IMOD - Interrupt Moderation Register. Used to throttle interrupts.
216+
* @imod: IMOD - Interrupt Moderation Register. Used to throttle interrupts.
217217
* @erst_size: ERSTSZ - Number of segments in the Event Ring Segment Table (ERST).
218218
* @erst_base: ERSTBA - Event ring segment table base address.
219219
* @erst_dequeue: ERDP - Event ring dequeue pointer.
@@ -227,7 +227,7 @@ struct xhci_op_regs {
227227
*/
228228
struct xhci_intr_reg {
229229
__le32 iman;
230-
__le32 irq_control;
230+
__le32 imod;
231231
__le32 erst_size;
232232
__le32 rsvd;
233233
__le64 erst_base;
@@ -240,15 +240,15 @@ struct xhci_intr_reg {
240240
/* bit 1 - Interrupt Enable (IE), whether the interrupter is capable of generating an interrupt */
241241
#define IMAN_IE (1 << 1)
242242

243-
/* irq_control bitmasks */
243+
/* imod bitmasks */
244244
/*
245245
* bits 15:0 - Interrupt Moderation Interval, the minimum interval between interrupts
246246
* (in 250ns intervals). The interval between interrupts will be longer if there are no
247247
* events on the event ring. Default is 4000 (1 ms).
248248
*/
249-
#define ER_IRQ_INTERVAL_MASK (0xffff)
249+
#define IMODI_MASK (0xffff)
250250
/* bits 31:16 - Interrupt Moderation Counter, used to count down the time to the next interrupt */
251-
#define ER_IRQ_COUNTER_MASK (0xffff << 16)
251+
#define IMODC_MASK (0xffff << 16)
252252

253253
/* erst_size bitmasks */
254254
/* bits 15:0 - Event Ring Segment Table Size, number of ERST entries */
@@ -1453,7 +1453,7 @@ struct xhci_interrupter {
14531453
u32 isoc_bei_interval;
14541454
/* For interrupter registers save and restore over suspend/resume */
14551455
u32 s3_iman;
1456-
u32 s3_irq_control;
1456+
u32 s3_imod;
14571457
u32 s3_erst_size;
14581458
u64 s3_erst_base;
14591459
u64 s3_erst_dequeue;

0 commit comments

Comments
 (0)