linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francisco@vger.kernel.org, Munoz@vger.kernel.org, Ruiz@vger.kernel.org
To: helgaas@kernel.org
Cc: lorenzo.pieralisi@arm.com, jonathan.derrick@linux.dev,
	linux-pci@vger.kernel.org,
	Nirmal Patel <nirmal.patel@linux.intel.com>,
	Francisco Munoz <francisco.munoz.ruiz@linux.intel.com>
Subject: [PATCH] PCI: vmd: Disable MSI remapping after suspend
Date: Mon,  7 Nov 2022 10:27:35 -0800	[thread overview]
Message-ID: <20221107182735.381552-1-francisco.munoz.ruiz@linux.intel.com> (raw)

From: Nirmal Patel <nirmal.patel@linux.intel.com>

MSI remapping is disbaled by VMD driver for intel's icelake and
newer systems in order to improve performance by setting MSI_RMP_DIS
bit. By design MSI_RMP_DIS bit of VMCONFIG registers is cleared.
The same register gets cleared when system is put in S3 power state.
VMD driver needs to set this register again in order to avoid
interrupt issues with devices behind VMD if MSI remapping was
disabled before.

Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Reviewed-by: Francisco Munoz <francisco.munoz.ruiz@linux.intel.com>
---
 drivers/pci/controller/vmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index e06e9f4fc50f..247012b343fd 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -980,6 +980,9 @@ static int vmd_resume(struct device *dev)
 	struct vmd_dev *vmd = pci_get_drvdata(pdev);
 	int err, i;
 
+	if (!vmd->irq_domain)
+		vmd_set_msi_remapping(vmd, false);
+
 	for (i = 0; i < vmd->msix_count; i++) {
 		err = devm_request_irq(dev, vmd->irqs[i].virq,
 				       vmd_irq, IRQF_NO_THREAD,
-- 
2.34.1


             reply	other threads:[~2022-11-07 18:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 18:27 Francisco, Munoz, Ruiz [this message]
2022-11-07 20:19 ` [PATCH] PCI: vmd: Disable MSI remapping after suspend Bjorn Helgaas
2022-11-08  2:49   ` Patel, Nirmal

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=20221107182735.381552-1-francisco.munoz.ruiz@linux.intel.com \
    --to=francisco@vger.kernel.org \
    --cc=Munoz@vger.kernel.org \
    --cc=Ruiz@vger.kernel.org \
    --cc=francisco.munoz.ruiz@linux.intel.com \
    --cc=helgaas@kernel.org \
    --cc=jonathan.derrick@linux.dev \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nirmal.patel@linux.intel.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;
as well as URLs for NNTP newsgroup(s).