[RFC 2/2] PCI: vmd: Provide default ASPM link state for synthetic hierarchy

From: David E. Box
Date: Wed Jul 16 2025 - 20:41:14 EST


Devices behind the VMD controller reside on a synthetic PCIe hierarchy that
is not visible to ACPI and not configured by firmware. As a result, these
devices receive no ASPM defaults from the BIOS, and ASPM remains disabled
unless explicitly enabled later.

Now that the ASPM core supports driver-supplied default link states via
pci_bus->aspm_bus_link_state, set this field on the VMD root bus to enable
ASPM for devices in the VMD domain. This ensures the platform's intended
power-saving configuration is applied during initialization without
requiring any special-case logic in the ASPM core.

Link: https://lore.kernel.org/linux-pm/0b166ece-eeec-ba5d-2212-50d995611cef@xxxxxxxxx
Signed-off-by: David E. Box <david.e.box@xxxxxxxxxxxxxxx>
---
drivers/pci/controller/vmd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 8df064b62a2f..a0d4e96ce872 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -730,7 +730,7 @@ static void vmd_copy_host_bridge_flags(struct pci_host_bridge *root_bridge,
}

/*
- * Enable ASPM and LTR settings on devices that aren't configured by BIOS.
+ * Enable LTR settings on devices that aren't configured by BIOS.
*/
static int vmd_pm_enable_quirk(struct pci_dev *pdev, void *userdata)
{
@@ -770,7 +770,6 @@ static int vmd_pm_enable_quirk(struct pci_dev *pdev, void *userdata)
* PCIe r6.0, sec 5.5.4.
*/
pci_set_power_state_locked(pdev, PCI_D0);
- pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL);
return 0;
}

@@ -911,6 +910,10 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
return -ENODEV;
}

+#ifdef CONFIG_PCIEASPM
+ vmd->bus->aspm_bus_link_state = PCIE_LINK_STATE_ALL;
+#endif
+
vmd_copy_host_bridge_flags(pci_find_host_bridge(vmd->dev->bus),
to_pci_host_bridge(vmd->bus->bridge));

--
2.43.0