Skip to contentSkip to conversation

thunderbolt: Mask ring interrupt on Intel hardware as well

PATCH Applied Mika Westerberg 1 participant 2 messages May 30, 2023 – May 31, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thunderbolt: Mask ring interrupt on Intel hardware as well

When resuming from system sleep states the driver issues following warning on Intel hardware:

thunderbolt 0000:07:00.0: interrupt for TX ring 0 is already enabled

The reason for this is that the commit in question did not mask the ring interrupt on Intel hardware leaving the interrupt active. Fix this by masking it also in Intel hardware.

Fixes c4af8e3fecd0 ("thunderbolt: Clear registers properly when auto clear isn't in use")
---
 drivers/thunderbolt/nhi.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/thunderbolt/nhi.c +8 -3
index 565892a2cdb9..a979f47109e3 100644
@@ -56,9 +56,14 @@ static int ring_interrupt_index(const struct tb_ring *ring)
 
 static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring)
 {
-	if (nhi->quirks & QUIRK_AUTO_CLEAR_INT)
-		return;
-	iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
+	if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) {
+		u32 val;
+
+		val = ioread32(nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
+		iowrite32(val & ~mask, nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
+	} else {
+		iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
+	}
 }
 
 static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring)
Signature · 1 line
2.39.2
author Applied
#1 lore raw
Quoted 9 lines · Mika Westerberg

When resuming from system sleep states the driver issues following warning on Intel hardware:

thunderbolt 0000:07:00.0: interrupt for TX ring 0 is already enabled

The reason for this is that the commit in question did not mask the ring interrupt on Intel hardware leaving the interrupt active. Fix this by masking it also in Intel hardware.

Quoted 6 lines
Fixes c4af8e3fecd0 ("thunderbolt: Clear registers properly when auto clear isn't in use")

Applied to thunderbolt.git/fixes.