diff mbox series

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

Message ID 20230208075013.196919-3-acelan.kao@canonical.com
State New
Headers show
Series [1/1,SRU,K] PCI: vmd: Disable MSI remapping after suspend | expand

Commit Message

AceLan Kao Feb. 8, 2023, 7:50 a.m. UTC
From: Nirmal Patel <nirmal.patel@linux.intel.com>

BugLink: https://launchpad.net/bugs/1996048

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.

Link: https://lore.kernel.org/r/20221109142652.450998-1-nirmal.patel@linux.intel.com
Fixes: ee81ee84f873 ("PCI: vmd: Disable MSI-X remapping when possible")
Signed-off-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Reviewed-by: Francisco Munoz <francisco.munoz.ruiz@linux.intel.com>
(cherry picked from commit d899aa668498c07ff217b666ae9712990306e682)
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 drivers/pci/controller/vmd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

AceLan Kao Feb. 8, 2023, 8:12 a.m. UTC | #1
Timo has submitted this patch for Kinetic
https://lists.ubuntu.com/archives/kernel-team/2023-January/136604.html
We still want this fix to be included in Jammy(5.15)
Timo Aaltonen Feb. 10, 2023, 7:59 a.m. UTC | #2
AceLan Kao kirjoitti 8.2.2023 klo 10.12:
> Timo has submitted this patch for Kinetic
> https://lists.ubuntu.com/archives/kernel-team/2023-January/136604.html
> We still want this fix to be included in Jammy(5.15)
> 

nah it's fine to apply from your submission, as I need to nack mine anyway
diff mbox series

Patch

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 94a14a3d7e55..de561f170d26 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -981,6 +981,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,