[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240604-pci_cfg_lockdep-v1-1-00da1706c9fd@linux.ibm.com>
Date: Tue, 04 Jun 2024 15:38:39 +0200
From: Niklas Schnelle <schnelle@...ux.ibm.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>,
Dan Williams <dan.j.williams@...el.com>,
Dave Jiang <dave.jiang@...el.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Matthew Rosato <mjrosato@...ux.ibm.com>,
Niklas Schnelle <schnelle@...ux.ibm.com>
Subject: [PATCH] PCI: Add missing lockdep assertion in
pci_cfg_access_trylock()
In commit 7e89efc6e9e4 ("PCI: Lock upstream bridge for
pci_reset_function()") it was missed that pci_cfg_access_trylock() needs
the same lockdep assertion as pci_cfg_access_lock(). This leads to false
positive lockdep splats for users of pci_cfg_access_trylock(). Add the
missing assertion when the lock was successfully acquired.
Fixes: 7e89efc6e9e4 ("PCI: Lock upstream bridge for pci_reset_function()")
Signed-off-by: Niklas Schnelle <schnelle@...ux.ibm.com>
---
drivers/pci/access.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/access.c b/drivers/pci/access.c
index 30f031de9cfe..5b6620da30d7 100644
--- a/drivers/pci/access.c
+++ b/drivers/pci/access.c
@@ -319,6 +319,8 @@ bool pci_cfg_access_trylock(struct pci_dev *dev)
dev->block_cfg_access = 1;
raw_spin_unlock_irqrestore(&pci_lock, flags);
+ if (locked)
+ lock_map_acquire(&dev->cfg_access_lock);
return locked;
}
EXPORT_SYMBOL_GPL(pci_cfg_access_trylock);
---
base-commit: c3f38fa61af77b49866b006939479069cd451173
change-id: 20240604-pci_cfg_lockdep-b6914e62d726
Best regards,
--
Niklas Schnelle
Powered by blists - more mailing lists