]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
eth: bnxt: avoid deadlock when canceling IRQ affinity notifier
authorJakub Kicinski <kuba@kernel.org>
Mon, 3 Aug 2026 19:31:35 +0000 (12:31 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 10 Aug 2026 22:15:06 +0000 (15:15 -0700)
commit51e96fa31f7e7eac2cba8f854e24d36600cc040b
tree49c9333b515d23cf4f4a011e5bbac38db259afa2
parent0fd562c7b9e48e7958f7405e54bf98e8e22ad184
eth: bnxt: avoid deadlock when canceling IRQ affinity notifier

Unregistering IRQ affinity notifiers waits for the callback synchronously.
bnxt takes the netdev instance lock in the notifier (to restart the queue)
and cancels the work under the same lock. This may obviously deadlock.

Move the restart to the async service task. The queue restart isn't
super time sensitive. Store the new TPH tag, schedule the task.
Safely canceling the service task is already ironed out.

In bnxt_request_irq() the order of registering notifier, affinity and
initial TPH programming has to be inverted. I think it was racy
previously since user may trigger an update as soon as notifier
is installed.

There's a small known gap - if pcie_tph_get_cpu_st() fails at init
and the target tag is 0 we may miss programming the entry.
This does not seem worth fixing, the code has skip-on-failure
all over the place, anyway.

Fixes: c214410c47d6 ("bnxt_en: Add TPH support in BNXT driver")
Tested-by: Vishvambar Panth S <vishvambar.panth-s@broadcom.com>
Link: https://patch.msgid.link/20260803193135.2030368-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h