diff options
author | Scott Bauer <scott.bauer@intel.com> | 2017-08-11 23:54:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-12 21:45:02 +0300 |
commit | b6666764b6a0a99308a126a8314523763d31978b (patch) | |
tree | b36559ed9f6480b06c7b71e22b79c7a41e9399a5 /drivers/pci | |
parent | 7f3829912e0ca5cfdca0fe6164fca4142ad87a9e (diff) | |
download | linux-b6666764b6a0a99308a126a8314523763d31978b.tar.xz |
PCI: vmd: Free up IRQs on suspend path
commit e2b1820bd5d0962d6f271b0d47c3a0e38647df2f 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 ...
Signed-off-by: Scott Bauer <scott.bauer@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Sushma Kalakota <sushmax.kalakota@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/vmd.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/host/vmd.c b/drivers/pci/host/vmd.c index 0e7f8f319fe3..9a60098f7b7d 100644 --- a/drivers/pci/host/vmd.c +++ b/drivers/pci/host/vmd.c @@ -731,6 +731,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 +744,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; |