linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown
@ 2015-03-12  5:21 Fam Zheng
  2015-03-12 16:21 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Fam Zheng @ 2015-03-12  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Bjorn Helgaas, linux-pci, famz

If the device doesn't support shutdown, disabling interrupts may cause
trouble. For example, virtio-scsi-pci doesn't implement shutdown, and
after we disable MSI-X, futher notifications from device will be
delivered to IRQ, which is unexpected. This IRQ will not be cleared, and
may prevent us from making progress, by keep triggering interrupts.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 drivers/pci/pci-driver.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 3cb2210..fb29c96 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -448,10 +448,11 @@ static void pci_device_shutdown(struct device *dev)
 
 	pm_runtime_resume(dev);
 
-	if (drv && drv->shutdown)
+	if (drv && drv->shutdown) {
 		drv->shutdown(pci_dev);
-	pci_msi_shutdown(pci_dev);
-	pci_msix_shutdown(pci_dev);
+		pci_msi_shutdown(pci_dev);
+		pci_msix_shutdown(pci_dev);
+	}
 
 #ifdef CONFIG_KEXEC
 	/*
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-16 12:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12  5:21 [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown Fam Zheng
2015-03-12 16:21 ` Paolo Bonzini
2015-03-12 23:21   ` Fam Zheng
2015-03-13 13:03     ` Paolo Bonzini
2015-03-12 23:56 ` Bandan Das
2015-03-13  2:09   ` Fam Zheng
2015-03-13  3:09     ` Bandan Das
2015-03-13  3:17       ` Fam Zheng
2015-03-13  3:35         ` Bandan Das
2015-03-13  4:13       ` Alex Williamson
2015-03-13  4:53         ` Fam Zheng
2015-03-16 12:14 ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).