]> www.infradead.org Git - users/jedix/linux-maple.git/commit
thunderbolt: Disable interrupt auto clear for rings
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 10 Mar 2023 17:20:50 +0000 (11:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:49:15 +0000 (12:49 +0200)
commit416db7fa3e8995566d7d151601db5c84a9a2830c
treea2d261e2497993320aaa0480ede3b5ab183bbee5
parentf390095bbd131ec2dfb29792d9f6fd0f0656bfc0
thunderbolt: Disable interrupt auto clear for rings

commit 468c49f44759720a312e52d44a71c3949ed63d7c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/nhi.c
drivers/thunderbolt/nhi_regs.h