Skip to content

Commit 04b12ef

Browse files
khfengLorenzo Pieralisi
authored andcommitted
PCI: vmd: Honor ACPI _OSC on PCIe features
When Samsung PCIe Gen4 NVMe is connected to Intel ADL VMD, the combination causes AER message flood and drags the system performance down. The issue doesn't happen when VMD mode is disabled in BIOS, since AER isn't enabled by acpi_pci_root_create() . When VMD mode is enabled, AER is enabled regardless of _OSC: [ 0.410076] acpi PNP0A08:00: _OSC: platform does not support [AER] ... [ 1.486704] pcieport 10000:e0:06.0: AER: enabled with IRQ 146 Since VMD is an aperture to regular PCIe root ports, honor ACPI _OSC to disable PCIe features accordingly to resolve the issue. Suggested-by: Rafael J. Wysocki <[email protected]> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215027 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Rafael J. Wysocki <[email protected]>
1 parent 6aab562 commit 04b12ef

File tree

1 file changed

+18
-0
lines changed
  • drivers/pci/controller

1 file changed

+18
-0
lines changed

drivers/pci/controller/vmd.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,21 @@ static int vmd_alloc_irqs(struct vmd_dev *vmd)
695695
return 0;
696696
}
697697

698+
/*
699+
* Since VMD is an aperture to regular PCIe root ports, only allow it to
700+
* control features that the OS is allowed to control on the physical PCI bus.
701+
*/
702+
static void vmd_copy_host_bridge_flags(struct pci_host_bridge *root_bridge,
703+
struct pci_host_bridge *vmd_bridge)
704+
{
705+
vmd_bridge->native_pcie_hotplug = root_bridge->native_pcie_hotplug;
706+
vmd_bridge->native_shpc_hotplug = root_bridge->native_shpc_hotplug;
707+
vmd_bridge->native_aer = root_bridge->native_aer;
708+
vmd_bridge->native_pme = root_bridge->native_pme;
709+
vmd_bridge->native_ltr = root_bridge->native_ltr;
710+
vmd_bridge->native_dpc = root_bridge->native_dpc;
711+
}
712+
698713
static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
699714
{
700715
struct pci_sysdata *sd = &vmd->sysdata;
@@ -832,6 +847,9 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
832847
return -ENODEV;
833848
}
834849

850+
vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
851+
to_pci_host_bridge(vmd->bus->bridge));
852+
835853
vmd_attach_resources(vmd);
836854
if (vmd->irq_domain)
837855
dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain);

0 commit comments

Comments
 (0)