From: Long Li <longli@exchange.microsoft.com>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Bjorn Helgaas <bhelgaas@google.com>
Cc: devel@linuxdriverproject.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Long Li <longli@microsoft.com>
Subject: [PATCH 2/2] pci-hyperv: properly handle device eject
Date: Mon, 12 Sep 2016 16:54:01 -0700 [thread overview]
Message-ID: <1473724441-21207-2-git-send-email-longli@exchange.microsoft.com> (raw)
In-Reply-To: <1473724441-21207-1-git-send-email-longli@exchange.microsoft.com>
From: Long Li <longli@microsoft.com>
A PCI_EJECT message can arrive at the same time we are calling pci_scan_child_bus in the workqueue for the previous PCI_BUS_RELATIONS message, in this case we could potentailly modify the bus from two places. Properly lock the bus access.
Signed-off-by: Long Li <longli@microsoft.com>
---
drivers/pci/host/pci-hyperv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 3c2b330..ca77009 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1587,7 +1587,7 @@ static void hv_eject_device_work(struct work_struct *work)
pdev = pci_get_domain_bus_and_slot(hpdev->hbus->sysdata.domain, 0,
wslot);
if (pdev) {
- pci_stop_and_remove_bus_device(pdev);
+ pci_stop_and_remove_bus_device_locked(pdev);
pci_dev_put(pdev);
}
--
1.8.5.6
next prev parent reply other threads:[~2016-09-12 22:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-12 23:54 [PATCH 1/2] pci-hyperv: properly handle pci bus remove Long Li
2016-09-12 23:54 ` Long Li [this message]
2016-09-13 9:50 ` [PATCH 2/2] pci-hyperv: properly handle device eject Dexuan Cui
2016-09-13 17:33 ` Long Li
2016-09-13 17:41 ` Long Li
2016-09-14 5:45 ` Dexuan Cui
2016-09-14 16:31 ` Long Li
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=1473724441-21207-2-git-send-email-longli@exchange.microsoft.com \
--to=longli@exchange.microsoft.com \
--cc=bhelgaas@google.com \
--cc=devel@linuxdriverproject.org \
--cc=haiyangz@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=longli@microsoft.com \
/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®