Skip to contentSkip to conversation

PCI: vmd: Disable MSI remapping after suspend

PATCH Applied Nirmal Patel 2 participants 2 messages Nov 9, 2022 – Nov 11, 2022

Subsystems (3)
lore
Share & tools
lore

Nirmal Patel

author maintainer
#0 lore raw

PATCH v2 1/1 PCI: vmd: Disable MSI remapping after suspend

MSI remapping is disabled by VMD driver for Intel's Icelake and newer systems in order to improve performance by setting VMCONFIG_MSI_REMAP. By design VMCONFIG_MSI_REMAP register is cleared by firmware during boot. 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.

Fixes ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible")

---
v1->v2: Updating commit log and removing firmware dependency.

---
 drivers/pci/controller/vmd.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/pci/controller/vmd.c +5 -0
index e06e9f4fc50f..98e0746e681c 100644
@@ -980,6 +980,11 @@ 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, true);
+       else
+               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,
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw
Quoted 9 lines · Nirmal Patel

MSI remapping is disabled by VMD driver for Intel's Icelake and newer systems in order to improve performance by setting VMCONFIG_MSI_REMAP. By design VMCONFIG_MSI_REMAP register is cleared by firmware during boot. 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.

[...]

Applied to pci/vmd, thanks!

[1/1] PCI: vmd: Disable MSI remapping after suspend

      https://git.kernel.org/lpieralisi/pci/c/d899aa668498

Thanks,
Lorenzo