stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: vmd: Free up IRQs on suspend path
@ 2019-02-06 21:36 Sushma Kalakota
  2019-02-07 11:07 ` Greg KH
  2019-02-11 13:37 ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Sushma Kalakota @ 2019-02-06 21:36 UTC (permalink / raw)
  To: stable
  Cc: Jon Derrick, Sushma Kalakota, Scott Bauer, Bjorn Helgaas,
	Keith Busch

commit e2b1820bd5d09 upstream

Free up the IRQs we request on the suspend path and reallocate them on the
resume path.

Fixes this error:

  CPU 111 disable failed: CPU has 9 vectors assigned and there are only 0 available.
  Error taking CPU111 down: -34
  Non-boot CPUs are not disabled
  Enabling non-boot CPUs ...

For consistency, this patch also includes the VMD portion of:
3eefa790c9681: PCI: host: Mark PCIe/PCI (MSI) cascade ISR as IRQF_NO_THREAD

CC: Scott Bauer <scott.bauer@intel.com>
CC: Bjorn Helgaas <bhelgaas@google.com>
CC: Keith Busch <keith.busch@intel.com>
Reviewed-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Sushma Kalakota <sushmax.kalakota@intel.com>
---
 drivers/pci/host/vmd.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/host/vmd.c b/drivers/pci/host/vmd.c
index 0e7f8f319fe3..5c2258ad3589 100644
--- a/drivers/pci/host/vmd.c
+++ b/drivers/pci/host/vmd.c
@@ -698,7 +698,8 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	for (i = 0; i < vmd->msix_count; i++) {
 		INIT_LIST_HEAD(&vmd->irqs[i].irq_list);
 		err = devm_request_irq(&dev->dev, pci_irq_vector(dev, i),
-				       vmd_irq, 0, "vmd", &vmd->irqs[i]);
+				       vmd_irq, IRQF_NO_THREAD,
+				       "vmd", &vmd->irqs[i]);
 		if (err)
 			return err;
 	}
@@ -731,6 +732,11 @@ static void vmd_remove(struct pci_dev *dev)
 static int vmd_suspend(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct vmd_dev *vmd = pci_get_drvdata(pdev);
+	int i;
+
+	for (i = 0; i < vmd->msix_count; i++)
+                devm_free_irq(dev, pci_irq_vector(pdev, i), &vmd->irqs[i]);
 
 	pci_save_state(pdev);
 	return 0;
@@ -739,6 +745,16 @@ static int vmd_suspend(struct device *dev)
 static int vmd_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
+	struct vmd_dev *vmd = pci_get_drvdata(pdev);
+	int err, i;
+
+	for (i = 0; i < vmd->msix_count; i++) {
+		err = devm_request_irq(dev, pci_irq_vector(pdev, i),
+				       vmd_irq, IRQF_NO_THREAD,
+				       "vmd", &vmd->irqs[i]);
+		if (err)
+			return err;
+	}
 
 	pci_restore_state(pdev);
 	return 0;
-- 
2.17.1


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

end of thread, other threads:[~2019-02-11 13:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-06 21:36 [PATCH] PCI: vmd: Free up IRQs on suspend path Sushma Kalakota
2019-02-07 11:07 ` Greg KH
2019-02-07 15:10   ` Derrick, Jonathan
2019-02-07 15:18     ` gregkh
2019-02-11 13:37 ` Greg KH

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).