From: Thomas Falcon <thomas.falcon@intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "David E . Box" <david.e.box@linux.intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Lukas Wunner <lukas@wunner.de>,
Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Thomas Falcon <thomas.falcon@intel.com>
Subject: [RFC PATCH v2 3/4] pcie/aspm: Enable all hardware power-saving states by default
Date: Mon, 11 May 2026 16:09:33 -0500 [thread overview]
Message-ID: <20260511210936.562622-4-thomas.falcon@intel.com> (raw)
In-Reply-To: <20260511210936.562622-1-thomas.falcon@intel.com>
For systems with a BIOS release date starting in 2025, default
ASPM policy to powersupersave if supported in the ACPI FADT.
Provide a flag, aspm_user_policy, tracking whether a user has
requested a specific power state to give those precedence.
Do not enable all states if user has chosen a specific policy
or disabled ASPM using the pcie_aspm module parameter.
Suggested-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
---
v2: -- Removed extra whitespace
-- Fixed unbalanced brackets
-- Replaced second dmi_bios_year_check() with pcie_aspm_legacy_config_check()
---
drivers/pci/pci-acpi.c | 3 +++
drivers/pci/pcie/aspm.c | 16 ++++++++++++++++
include/linux/pci.h | 1 +
3 files changed, 20 insertions(+)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 4d0f2cb6c695..c73a6b06fc43 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -1523,6 +1523,9 @@ static int __init acpi_pci_init(void)
if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
pr_info("ACPI FADT declares the system doesn't support PCIe ASPM, so disable it\n");
pcie_no_aspm();
+ } else {
+ /* If ASPM is supported, configure the default policy here. */
+ pcie_aspm_policy_config_init();
}
if (acpi_pci_disabled)
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index e93b72494534..063ebe81a9cd 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -267,6 +267,8 @@ static int aspm_policy = POLICY_POWER_SUPERSAVE;
#else
static int aspm_policy;
#endif
+static int aspm_default_policy = POLICY_POWER_SUPERSAVE;
+static bool aspm_user_policy;
static const char *policy_str[] = {
[POLICY_DEFAULT] = "default",
@@ -1609,6 +1611,7 @@ static int pcie_aspm_set_policy(const char *val,
down_read(&pci_bus_sem);
mutex_lock(&aspm_lock);
aspm_policy = i;
+ aspm_user_policy = true;
list_for_each_entry(link, &link_list, sibling) {
pcie_config_aspm_link(link, policy_to_aspm_state(link));
pcie_set_clkpm(link, policy_to_clkpm_state(link));
@@ -1810,6 +1813,19 @@ static int __init pcie_aspm_disable(char *str)
__setup("pcie_aspm=", pcie_aspm_disable);
+void __init pcie_aspm_policy_config_init(void)
+{
+ /*
+ * Set ASPM policy here, enabling all power-saving states
+ * unless ASPM has been disabled or the user has already
+ * requested a policy or the systems BIOS release date
+ * is before the year 2025. Otherwise use BIOS defaults.
+ */
+ if (!aspm_disabled && !aspm_user_policy &&
+ !pcie_aspm_legacy_config_check())
+ aspm_policy = aspm_default_policy;
+}
+
void pcie_no_aspm(void)
{
/*
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2c4454583c11..36fa5579709c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1915,6 +1915,7 @@ int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
int pci_enable_link_state(struct pci_dev *pdev, int state);
int pci_enable_link_state_locked(struct pci_dev *pdev, int state);
void pcie_no_aspm(void);
+void pcie_aspm_policy_config_init(void);
bool pcie_aspm_support_enabled(void);
bool pcie_aspm_enabled(struct pci_dev *pdev);
#else
--
2.43.0
next prev parent reply other threads:[~2026-05-11 21:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 21:09 [RFC PATCH v2 0/4] pcie/aspm: Enable all advertised ASPM states by default Thomas Falcon
2026-05-11 21:09 ` [RFC PATCH v2 1/4] pcie/aspm: Add debug logging for aspm policy config Thomas Falcon
2026-05-11 21:09 ` [RFC PATCH v2 2/4] pcie/aspm: Enable all power-saving states during link state initialization Thomas Falcon
2026-05-11 21:09 ` Thomas Falcon [this message]
2026-05-11 21:09 ` [RFC PATCH v2 4/4] pcie/aspm: Remove CONFIG_PCIEASPM_* policy definitions Thomas Falcon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260511210936.562622-4-thomas.falcon@intel.com \
--to=thomas.falcon@intel.com \
--cc=bhelgaas@google.com \
--cc=david.e.box@linux.intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox