Skip to content

Commit 9f9666e

Browse files
committed
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. Reported-by: beld zhang <[email protected]> Tested-by: beld zhang <[email protected]> Closes: https://lore.kernel.org/linux-usb/[email protected]/ Fixes: c4af8e3 ("thunderbolt: Clear registers properly when auto clear isn't in use") Cc: [email protected] Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent 3fe9574 commit 9f9666e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/thunderbolt/nhi.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ static int ring_interrupt_index(const struct tb_ring *ring)
5656

5757
static void nhi_mask_interrupt(struct tb_nhi *nhi, int mask, int ring)
5858
{
59-
if (nhi->quirks & QUIRK_AUTO_CLEAR_INT)
60-
return;
61-
iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
59+
if (nhi->quirks & QUIRK_AUTO_CLEAR_INT) {
60+
u32 val;
61+
62+
val = ioread32(nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
63+
iowrite32(val & ~mask, nhi->iobase + REG_RING_INTERRUPT_BASE + ring);
64+
} else {
65+
iowrite32(mask, nhi->iobase + REG_RING_INTERRUPT_MASK_CLEAR_BASE + ring);
66+
}
6267
}
6368

6469
static void nhi_clear_interrupt(struct tb_nhi *nhi, int ring)

0 commit comments

Comments
 (0)