All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Bauer <scott.bauer@intel.com>
To: linux-pci@vger.kernel.org
Cc: keith.busch@intel.com, jonathan.derrick@intel.com,
	david.fugate@intel.com, bhelgaas@google.com,
	Scott Bauer <scott.bauer@intel.com>
Subject: [PATCH] PCI: vmd: Free up IRQs on suspend path
Date: Thu, 20 Jul 2017 14:28:58 -0600	[thread overview]
Message-ID: <20170720202858.1918-1-scott.bauer@intel.com> (raw)

This patch frees up the IRQs we request on the suspend path,
and reallocates them on the resume path.

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

Signed-off-by: Scott Bauer <scott.bauer@intel.com>
---
 drivers/pci/host/vmd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/pci/host/vmd.c b/drivers/pci/host/vmd.c
index 6088c3083194..88bf0c754fb2 100644
--- a/drivers/pci/host/vmd.c
+++ b/drivers/pci/host/vmd.c
@@ -755,6 +755,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;
@@ -763,7 +768,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.11.0

             reply	other threads:[~2017-07-20 20:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-20 20:28 Scott Bauer [this message]
2017-07-26  2:15 ` [PATCH] PCI: vmd: Free up IRQs on suspend path Jon Derrick
2017-07-20 21:34   ` Scott Bauer
2017-07-26  2:36     ` Jon Derrick
2017-07-20 21:56       ` Scott Bauer
2017-07-20 22:41         ` Keith Busch
  -- strict thread matches above, loose matches on Subject: below --
2017-08-11 20:54 Scott Bauer
2017-08-14 18:06 ` Bjorn Helgaas
2017-08-14 18:15   ` Keith Busch
2017-08-14 20:30 ` Bjorn Helgaas
2019-02-06 21:36 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

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=20170720202858.1918-1-scott.bauer@intel.com \
    --to=scott.bauer@intel.com \
    --cc=bhelgaas@google.com \
    --cc=david.fugate@intel.com \
    --cc=jonathan.derrick@intel.com \
    --cc=keith.busch@intel.com \
    --cc=linux-pci@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.