]> www.infradead.org Git - users/hch/misc.git/commit
usb: xhci: improve Interrupt Management register macros
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Thu, 15 May 2025 13:56:12 +0000 (16:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 10:35:33 +0000 (12:35 +0200)
commit9f7f74735ac295c9c32ac9152c362414e18d35cc
tree9274a8656de5651548362396a8bb86bdbaecf70d
parent1fdeb069053f65e974c6fd945c85fcb854e6c199
usb: xhci: improve Interrupt Management register macros

The Interrupt Management register (IMAN), contains three fields:
 - Bit 0: Interrupt Pending (IP)
 - Bit 1: Interrupt Enable (IE)
 - Bits 31:2: RsvdP (Reserved and Preserved)

Currently, there are multiple macros for both the IP and IE fields.
Consolidates them into single mask macros for better clarity and
maintainability.

Comment "THIS IS BUGGY - FIXME - IP IS WRITE 1 TO CLEAR" refers to the
fact that both macros 'ER_IRQ_ENABLE' and 'ER_IRQ_DISABLE' clear the IP bit
by writing '0' before modifying the IE bit. However, the IP bit is actually
cleared by writing '1'. To prevent any regression, this behavior has not
been altered. Instead, when the IE bit is modified, the IP macro is used
explicitly to highlight this "quirk".

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-16-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h