From: Hans Zhang <18255117159@163.com>
To: bhelgaas@google.com, lpieralisi@kernel.org,
kwilczynski@kernel.org, mani@kernel.org
Cc: robh@kernel.org, a-garg7@ti.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Hans Zhang <18255117159@163.com>
Subject: [PATCH 8/9] PCI: vmd: Protect root bus removal with rescan lock
Date: Fri, 22 May 2026 00:18:21 +0800 [thread overview]
Message-ID: <20260521161822.132996-9-18255117159@163.com> (raw)
In-Reply-To: <20260521161822.132996-1-18255117159@163.com>
Hold pci_rescan_remove_global_lock while stopping and removing the VMD
root bus in vmd_remove() to prevent races with PCI rescan operations.
Signed-off-by: Hans Zhang <18255117159@163.com>
---
drivers/pci/controller/vmd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index d4ae250d4bc6..9565567026cf 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -1056,9 +1056,11 @@ static void vmd_remove(struct pci_dev *dev)
{
struct vmd_dev *vmd = pci_get_drvdata(dev);
+ pci_lock_rescan_remove();
pci_stop_root_bus(vmd->bus);
sysfs_remove_link(&vmd->dev->dev.kobj, "domain");
pci_remove_root_bus(vmd->bus);
+ pci_unlock_rescan_remove();
vmd_cleanup_srcu(vmd);
vmd_detach_resources(vmd);
vmd_remove_irq_domain(vmd);
--
2.34.1
next prev parent reply other threads:[~2026-05-21 16:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 16:18 [PATCH 0/9] PCI: controller: Add missing rescan lock around root bus removal Hans Zhang
2026-05-21 16:18 ` [PATCH 1/9] PCI: cadence: Protect root bus removal with rescan lock Hans Zhang
2026-05-21 16:18 ` [PATCH 2/9] PCI: dwc: " Hans Zhang
2026-05-21 16:18 ` [PATCH 3/9] PCI: altera: " Hans Zhang
2026-05-21 16:18 ` [PATCH 4/9] PCI: brcmstb: " Hans Zhang
2026-05-21 16:18 ` [PATCH 5/9] PCI: iproc: " Hans Zhang
2026-05-21 16:18 ` [PATCH 6/9] PCI: mediatek: " Hans Zhang
2026-05-21 16:18 ` [PATCH 7/9] PCI: rockchip: " Hans Zhang
2026-05-21 16:18 ` Hans Zhang [this message]
2026-05-21 16:18 ` [PATCH 9/9] PCI: plda: " Hans Zhang
2026-06-11 7:04 ` (subset) [PATCH 0/9] PCI: controller: Add missing rescan lock around root bus removal Manivannan Sadhasivam
2026-06-18 16:59 ` Bjorn Helgaas
2026-06-19 15:20 ` Hans Zhang
2026-06-22 17:12 ` Bjorn Helgaas
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=20260521161822.132996-9-18255117159@163.com \
--to=18255117159@163.com \
--cc=a-garg7@ti.com \
--cc=bhelgaas@google.com \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=robh@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
all inboxes | Powered by JetHome®