From: Moshe Shemesh <moshe@nvidia.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Dan Williams <dan.j.williams@intel.com>,
Dave Jiang <dave.jiang@intel.com>,
Keith Busch <kbusch@kernel.org>, <linux-pci@vger.kernel.org>
Cc: Moshe Shemesh <moshe@nvidia.com>
Subject: [PATCH] PCI: Fix missing update in pci_slot_unlock() after locking changes
Date: Sun, 4 May 2025 19:31:32 +0300 [thread overview]
Message-ID: <1746376292-1827952-1-git-send-email-moshe@nvidia.com> (raw)
The cited patch updated pci_slot_lock(), pci_slot_trylock(),
pci_bus_lock(), and pci_bus_trylock() recursive locking, and adjusted
pci_bus_unlock() accordingly. However, it missed updating
pci_slot_unlock(), which may lead to attempting to unlock the
subordinate bridge's device lock twice.
Fixes: a4e772898f8b ("PCI: Add missing bridge lock to pci_bus_lock()")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
---
drivers/pci/pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4d7c9f64ea24..26507aa906d7 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5542,7 +5542,8 @@ static void pci_slot_unlock(struct pci_slot *slot)
continue;
if (dev->subordinate)
pci_bus_unlock(dev->subordinate);
- pci_dev_unlock(dev);
+ else
+ pci_dev_unlock(dev);
}
}
--
2.18.2
next reply other threads:[~2025-05-04 16:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-04 16:31 Moshe Shemesh [this message]
2025-05-04 17:53 ` [PATCH] PCI: Fix missing update in pci_slot_unlock() after locking changes Lukas Wunner
2025-05-04 20:16 ` Moshe Shemesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1746376292-1827952-1-git-send-email-moshe@nvidia.com \
--to=moshe@nvidia.com \
--cc=bhelgaas@google.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=kbusch@kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox