OSDN Git Service

thunderbolt: Disable interrupt auto clear for rings
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 10 Mar 2023 17:20:50 +0000 (11:20 -0600)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 20 Mar 2023 07:38:40 +0000 (09:38 +0200)
commit468c49f44759720a312e52d44a71c3949ed63d7c
tree1e46bf9682eddc5ada7f3de7b3dd0384682e8d65
parent1716efdb07938bd6510e1127d02012799112c433
thunderbolt: Disable interrupt auto clear for rings

When interrupt auto clear is programmed, any read to the interrupt
status register will clear all interrupts.  If two interrupts have
come in before one can be serviced then this will cause lost interrupts.

On AMD USB4 routers this has manifested in odd problems particularly
with long strings of control tranfers such as reading the DROM via bit
banging.

Instead of clearing interrupts automatically, clear the bit corresponding
to the given ring's interrupt in the ISR.

Fixes: 7a1808f82a37 ("thunderbolt: Handle ring interrupt by reading interrupt status register")
Cc: Sanju Mehta <Sanju.Mehta@amd.com>
Cc: stable@vger.kernel.org
Tested-by: Anson Tsao <anson.tsao@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/nhi.c
drivers/thunderbolt/nhi_regs.h