Skip to content

Commit 920f646

Browse files
djbwbjorn-helgaas
authored andcommitted
PCI: Warn on missing cfg_access_lock during secondary bus reset
The recent adventure with adding lockdep tracking for cfg_access_lock, while it yielded many false positives [1], did catch a true positive in the pci_reset_bus() path [2]. So, while lockdep is difficult to deploy, open coding a check that cfg_access_lock is held during the reset is feasible. While this does not offer a full backtrace, it should be sufficient to implicate the caller of pci_bridge_secondary_bus_reset() as a path that needs investigation. Link: https://lore.kernel.org/r/171711746953.1628941.4692125082286867825.stgit@dwillia2-xfh.jf.intel.com Link: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_134186v1/shard-dg2-1/igt@[email protected] [1] Link: http://lore.kernel.org/r/[email protected] [2] Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Tested-by: Hans de Goede <[email protected]> Tested-by: Kalle Valo <[email protected]> Reviewed-by: Dave Jiang <[email protected]>
1 parent 1613e60 commit 920f646

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/pci/pci.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4884,6 +4884,9 @@ void __weak pcibios_reset_secondary_bus(struct pci_dev *dev)
48844884
int pci_bridge_secondary_bus_reset(struct pci_dev *dev)
48854885
{
48864886
lock_map_assert_held(&dev->cfg_access_lock);
4887+
if (!dev->block_cfg_access)
4888+
pci_warn_once(dev, "unlocked secondary bus reset via: %pS\n",
4889+
__builtin_return_address(0));
48874890
pcibios_reset_secondary_bus(dev);
48884891

48894892
return pci_bridge_wait_for_secondary_bus(dev, "bus reset");

0 commit comments

Comments
 (0)