]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: tegra: Convert struct tegra_msi mask_lock into raw spinlock
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Mon, 22 Sep 2025 15:07:48 +0000 (17:07 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 25 Sep 2025 23:02:30 +0000 (18:02 -0500)
commit26fda92d3b56bf44a02bcb4001c5a5548e0ae8ee
treeb8986ddf8dec29eb627d20e0ee0a1cb96991e4c2
parent4f152338e384a3a47dd61909e1457539fa93f5a4
PCI: tegra: Convert struct tegra_msi mask_lock into raw spinlock

The tegra_msi_irq_unmask() function may be called from a PCI driver
request_threaded_irq() function. This triggers kernel/irq/manage.c
__setup_irq() which locks raw spinlock &desc->lock descriptor lock
and with that descriptor lock held, calls tegra_msi_irq_unmask().

Since the &desc->lock descriptor lock is a raw spinlock, and the tegra_msi
.mask_lock is not a raw spinlock, this setup triggers 'BUG: Invalid wait
context' with CONFIG_PROVE_RAW_LOCK_NESTING=y.

Use scoped_guard() to simplify the locking.

Fixes: 2c99e55f7955 ("PCI: tegra: Convert to MSI domains")
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Closes: https://patchwork.kernel.org/project/linux-pci/patch/20250909162707.13927-2-marek.vasut+renesas@mailbox.org/#26574451
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20250922150811.88450-1-marek.vasut+renesas@mailbox.org
drivers/pci/controller/pci-tegra.c