@@ -701,7 +701,8 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
aspm_l1ss_init(link);
/* Save default state */
- link->aspm_default = link->aspm_enabled;
+ link->aspm_default = parent->dev_flags & PCI_DEV_FLAGS_ENABLE_ASPM ?
+ ASPM_STATE_ALL : link->aspm_enabled;
/* Setup initial capable state. Will be updated later */
link->aspm_capable = link->aspm_support;
@@ -1226,7 +1227,7 @@ int pci_enable_link_state(struct pci_dev *pdev, int state)
* systems we have to observe the FADT ACPI_FADT_NO_ASPM bit and
* the _OSC method), we can't honor that request.
*/
- if (aspm_disabled) {
+ if (aspm_disabled && !(pdev->dev_flags & PCI_DEV_FLAGS_ENABLE_ASPM)) {
pci_warn(pdev, "can't override BIOS ASPM; OS doesn't have ASPM control\n");
return -EPERM;
}
@@ -244,6 +244,8 @@ enum pci_dev_flags {
PCI_DEV_FLAGS_NO_RELAXED_ORDERING = (__force pci_dev_flags_t) (1 << 11),
/* Device does honor MSI masking despite saying otherwise */
PCI_DEV_FLAGS_HAS_MSI_MASKING = (__force pci_dev_flags_t) (1 << 12),
+ /* Enable ASPM regardless of how LnkCtl is programmed */
+ PCI_DEV_FLAGS_ENABLE_ASPM = (__force pci_dev_flags_t) (1 << 13),
};
enum pci_irq_reroute_variant {
BugLink: https://bugs.launchpad.net/bugs/2034504 On cases where BIOS can't program ASPM registers, allow the driver to do so, essentially ignoring the FADT ASPM flag. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> --- drivers/pci/pcie/aspm.c | 5 +++-- include/linux/pci.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-)