* [RFC PATCH 1/4] pcie/aspm: Add debug logging for aspm policy config
2026-04-29 18:06 [RFC PATCH 0/4] pcie/aspm: Enable all advertised ASPM states by default Thomas Falcon
@ 2026-04-29 18:06 ` Thomas Falcon
2026-04-29 18:06 ` [RFC PATCH 2/4] pcie/aspm: Enable all power-saving states during link state initialization Thomas Falcon
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Thomas Falcon @ 2026-04-29 18:06 UTC (permalink / raw)
To: Bjorn Helgaas, Rafael J . Wysocki
Cc: David E . Box, Lukas Wunner, Manivannan Sadhasivam, Len Brown,
linux-pci, linux-kernel, Thomas Falcon
Include additional logging for ASPM and Clock PM state changes
keeping track of code flow and enabled power saving states.
Example output after enabling powersupersave policy:
[ 130.179249] pcieport 0000:80:1b.0: Updating ASPM state
[ 130.179256] igc 0000:81:00.0: ASPM: Disabling ASPM on this device before disabling parent
[ 130.179368] pcieport 0000:80:1b.0: ASPM: Disabling ASPM before applying configuration
[ 130.179373] pcieport 0000:80:1b.0: ASPM: Configure L1 substates
[ 130.179391] pcieport 0000:80:1b.0: ASPM: Configure ASPM state on upstream device
[ 130.179395] igc 0000:81:00.0: ASPM: Configure ASPM state on downstream device
[ 130.179401] pcieport 0000:80:1b.0: ASPM: enabled states: L1 ASPM-L1.1 PCI-PM-L1.1 PCI-PM-L1.2
[ 130.179416] pcieport 0000:00:06.0: Updating ASPM state
[ 130.179418] nvme 0000:01:00.0: ASPM: Disabling ASPM on this device before disabling parent
[ 130.179422] pcieport 0000:00:06.0: ASPM: Disabling ASPM before applying configuration
[ 130.179425] pcieport 0000:00:06.0: ASPM: Configure L1 substates
[ 130.179435] pcieport 0000:00:06.0: ASPM: Configure ASPM state on upstream device
[ 130.179438] nvme 0000:01:00.0: ASPM: Configure ASPM state on downstream device
[ 130.179442] pcieport 0000:00:06.0: ASPM: enabled states: L1 ASPM-L1.1 ASPM-L1.2 PCI-PM-L1.1 PCI-PM-L1.2
Suggested-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
---
drivers/pci/pcie/aspm.c | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 925373b98dff..cd23c1462502 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -372,6 +372,9 @@ static void pcie_set_clkpm(struct pcie_link_state *link, int enable)
/* Need nothing if the specified equals to current state */
if (link->clkpm_enabled == enable)
return;
+
+ pci_dbg(link->pdev, "%s Clock PM\n",
+ enable ? "Enabling" : "Disabling");
pcie_set_clkpm_nocheck(link, enable);
}
@@ -961,11 +964,14 @@ static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state)
state &= (link->aspm_capable & ~link->aspm_disable);
/* Can't enable any substates if L1 is not enabled */
- if (!(state & PCIE_LINK_STATE_L1))
+ if (!(state & PCIE_LINK_STATE_L1)) {
+ pci_dbg(parent, "ASPM: L1 not enabled, disabling L1 substates\n");
state &= ~PCIE_LINK_STATE_L1SS;
+ }
/* Spec says both ports must be in D0 before enabling PCI PM substates*/
if (parent->current_state != PCI_D0 || child->current_state != PCI_D0) {
+ pci_dbg(parent, "ASPM: Both ports are not in D0, disable PCI PM L1 substates unless explicitly enabled\n");
state &= ~PCIE_LINK_STATE_L1_SS_PCIPM;
state |= (link->aspm_enabled & PCIE_LINK_STATE_L1_SS_PCIPM);
}
@@ -973,6 +979,8 @@ static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state)
/* Nothing to do if the link is already in the requested state */
if (link->aspm_enabled == state)
return;
+ pci_dbg(parent, "Updating ASPM state\n");
+
/* Convert ASPM state to upstream/downstream ASPM register state */
if (state & PCIE_LINK_STATE_L0S_UP)
dwstream |= PCI_EXP_LNKCTL_ASPM_L0S;
@@ -997,16 +1005,34 @@ static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state)
* Sec 7.5.3.7 also recommends programming the same ASPM Control
* value for all functions of a multi-function device.
*/
- list_for_each_entry(child, &linkbus->devices, bus_list)
+ list_for_each_entry(child, &linkbus->devices, bus_list) {
+ pci_dbg(child, "ASPM: Disabling ASPM on this device before disabling parent\n");
pcie_config_aspm_dev(child, 0);
+ }
+ pci_dbg(parent, "ASPM: Disabling ASPM before applying configuration\n");
pcie_config_aspm_dev(parent, 0);
- if (link->aspm_capable & PCIE_LINK_STATE_L1SS)
+ if (link->aspm_capable & PCIE_LINK_STATE_L1SS) {
+ pci_dbg(parent, "ASPM: Configure L1 substates\n");
pcie_config_aspm_l1ss(link, state);
+ }
+ pci_dbg(parent, "ASPM: Configure ASPM state on upstream device\n");
pcie_config_aspm_dev(parent, upstream);
- list_for_each_entry(child, &linkbus->devices, bus_list)
+ list_for_each_entry(child, &linkbus->devices, bus_list) {
+ pci_dbg(child, "ASPM: Configure ASPM state on downstream device\n");
pcie_config_aspm_dev(child, dwstream);
+ }
+
+ pci_dbg(parent, "ASPM: enabled states:%s%s%s%s%s%s%s%s\n",
+ FLAG(state, L0S_UP, " L0s-Upstream"),
+ FLAG(state, L0S_DW, " L0s-Downstream"),
+ FLAG(state, L1, " L1"),
+ FLAG(state, L1_1, " ASPM-L1.1"),
+ FLAG(state, L1_2, " ASPM-L1.2"),
+ FLAG(state, L1_1_PCIPM, " PCI-PM-L1.1"),
+ FLAG(state, L1_2_PCIPM, " PCI-PM-L1.2"),
+ FLAG(state, CLKPM, " ClockPM"));
link->aspm_enabled = state;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [RFC PATCH 2/4] pcie/aspm: Enable all power-saving states during link state initialization
2026-04-29 18:06 [RFC PATCH 0/4] pcie/aspm: Enable all advertised ASPM states by default Thomas Falcon
2026-04-29 18:06 ` [RFC PATCH 1/4] pcie/aspm: Add debug logging for aspm policy config Thomas Falcon
@ 2026-04-29 18:06 ` Thomas Falcon
2026-04-29 18:06 ` [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default Thomas Falcon
2026-04-29 18:06 ` [RFC PATCH 4/4] pcie/aspm: Remove CONFIG_PCIEASPM_* policy definitions Thomas Falcon
3 siblings, 0 replies; 7+ messages in thread
From: Thomas Falcon @ 2026-04-29 18:06 UTC (permalink / raw)
To: Bjorn Helgaas, Rafael J . Wysocki
Cc: David E . Box, Lukas Wunner, Manivannan Sadhasivam, Len Brown,
linux-pci, linux-kernel, Thomas Falcon
Setting powersave and powersupersave states at ASPM
link state initialization allows for a simpler and more
maintainable enabling flow that presumes all advertised
power states work. Restrict this behavior to systems
with a BIOS release during or after 2025.
Suggested-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
---
drivers/pci/pcie/aspm.c | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index cd23c1462502..84d49aa8a5ba 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -24,6 +24,7 @@
#include <linux/printk.h>
#include <linux/slab.h>
#include <linux/time.h>
+#include <linux/dmi.h>
#include "../pci.h"
@@ -1057,6 +1058,23 @@ static void free_link_state(struct pcie_link_state *link)
kfree(link);
}
+static int pcie_aspm_legacy_config_check(void)
+{
+ static bool legacy_aspm_config;
+ static bool checked;
+
+ if (checked)
+ return legacy_aspm_config;
+ if (dmi_get_bios_year() < 2025)
+ legacy_aspm_config = true;
+
+ pr_info("ASPM configuration is determined at %s time\n",
+ legacy_aspm_config ? "build" : "boot");
+ checked = true;
+
+ return legacy_aspm_config;
+}
+
static int pcie_aspm_sanity_check(struct pci_dev *pdev)
{
struct pci_dev *child;
@@ -1196,8 +1214,9 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
* the BIOS's expectation, we'll do so once pci_enable_device() is
* called.
*/
- if (aspm_policy != POLICY_POWERSAVE &&
- aspm_policy != POLICY_POWER_SUPERSAVE) {
+ if (!pcie_aspm_legacy_config_check() ||
+ (aspm_policy != POLICY_POWERSAVE &&
+ aspm_policy != POLICY_POWER_SUPERSAVE)) {
pcie_config_aspm_path(link);
pcie_set_clkpm(link, policy_to_clkpm_state(link));
}
@@ -1379,8 +1398,9 @@ void pcie_aspm_powersave_config_link(struct pci_dev *pdev)
if (aspm_disabled || !link)
return;
- if (aspm_policy != POLICY_POWERSAVE &&
- aspm_policy != POLICY_POWER_SUPERSAVE)
+ if (!pcie_aspm_legacy_config_check() ||
+ (aspm_policy != POLICY_POWERSAVE &&
+ aspm_policy != POLICY_POWER_SUPERSAVE))
return;
down_read(&pci_bus_sem);
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default
2026-04-29 18:06 [RFC PATCH 0/4] pcie/aspm: Enable all advertised ASPM states by default Thomas Falcon
2026-04-29 18:06 ` [RFC PATCH 1/4] pcie/aspm: Add debug logging for aspm policy config Thomas Falcon
2026-04-29 18:06 ` [RFC PATCH 2/4] pcie/aspm: Enable all power-saving states during link state initialization Thomas Falcon
@ 2026-04-29 18:06 ` Thomas Falcon
2026-04-30 10:17 ` Ilpo Järvinen
2026-04-29 18:06 ` [RFC PATCH 4/4] pcie/aspm: Remove CONFIG_PCIEASPM_* policy definitions Thomas Falcon
3 siblings, 1 reply; 7+ messages in thread
From: Thomas Falcon @ 2026-04-29 18:06 UTC (permalink / raw)
To: Bjorn Helgaas, Rafael J . Wysocki
Cc: David E . Box, Lukas Wunner, Manivannan Sadhasivam, Len Brown,
linux-pci, linux-kernel, Thomas Falcon
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>
---
drivers/pci/pci-acpi.c | 4 +++-
drivers/pci/pcie/aspm.c | 17 +++++++++++++++++
include/linux/pci.h | 1 +
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 4d0f2cb6c695..d849bc6d0c0c 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -1523,7 +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)
return 0;
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 84d49aa8a5ba..1c81e2f2e589 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,20 @@ 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 && dmi_get_bios_year() >= 2025)
+ 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
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default
2026-04-29 18:06 ` [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default Thomas Falcon
@ 2026-04-30 10:17 ` Ilpo Järvinen
2026-04-30 22:19 ` Falcon, Thomas
0 siblings, 1 reply; 7+ messages in thread
From: Ilpo Järvinen @ 2026-04-30 10:17 UTC (permalink / raw)
To: Thomas Falcon
Cc: Bjorn Helgaas, Rafael J . Wysocki, David E . Box, Lukas Wunner,
Manivannan Sadhasivam, Len Brown, linux-pci, LKML
On Wed, 29 Apr 2026, Thomas Falcon wrote:
> 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>
> ---
> drivers/pci/pci-acpi.c | 4 +++-
> drivers/pci/pcie/aspm.c | 17 +++++++++++++++++
> include/linux/pci.h | 1 +
> 3 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> index 4d0f2cb6c695..d849bc6d0c0c 100644
> --- a/drivers/pci/pci-acpi.c
> +++ b/drivers/pci/pci-acpi.c
> @@ -1523,7 +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();
Please balance braces (and with comment this is multiline block anyway
so you should use braces even because of that).
>
> if (acpi_pci_disabled)
> return 0;
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 84d49aa8a5ba..1c81e2f2e589 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,20 @@ static int __init pcie_aspm_disable(char *str)
>
> __setup("pcie_aspm=", pcie_aspm_disable);
>
> +
> +
Extra empty lines.
> +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 && dmi_get_bios_year() >= 2025)
Is it good to have this 2025 check in two places as literals, should there
be only one function which is called by both places?
> + 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
>
--
i.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default
2026-04-30 10:17 ` Ilpo Järvinen
@ 2026-04-30 22:19 ` Falcon, Thomas
0 siblings, 0 replies; 7+ messages in thread
From: Falcon, Thomas @ 2026-04-30 22:19 UTC (permalink / raw)
To: ilpo.jarvinen@linux.intel.com
Cc: david.e.box@linux.intel.com, rafael@kernel.org, lenb@kernel.org,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
manivannan.sadhasivam@oss.qualcomm.com, bhelgaas@google.com,
lukas@wunner.de
On Thu, 2026-04-30 at 13:17 +0300, Ilpo Järvinen wrote:
> On Wed, 29 Apr 2026, Thomas Falcon wrote:
>
> > 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>
> > ---
> > drivers/pci/pci-acpi.c | 4 +++-
> > drivers/pci/pcie/aspm.c | 17 +++++++++++++++++
> > include/linux/pci.h | 1 +
> > 3 files changed, 21 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
> > index 4d0f2cb6c695..d849bc6d0c0c 100644
> > --- a/drivers/pci/pci-acpi.c
> > +++ b/drivers/pci/pci-acpi.c
> > @@ -1523,7 +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();
>
> Please balance braces (and with comment this is multiline block
> anyway
> so you should use braces even because of that).
Thanks, I will fix this in the next version.
>
> >
> > if (acpi_pci_disabled)
> > return 0;
> > diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> > index 84d49aa8a5ba..1c81e2f2e589 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,20 @@ static int __init pcie_aspm_disable(char
> > *str)
> >
> > __setup("pcie_aspm=", pcie_aspm_disable);
> >
> > +
> > +
>
> Extra empty lines.
Oops, I will fix in v2.
>
> > +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 &&
> > dmi_get_bios_year() >= 2025)
>
> Is it good to have this 2025 check in two places as literals, should
> there
> be only one function which is called by both places?
Ok, might be able to use pcie_aspm_legacy_config_check from the
previous patch here. I will fix in v2.
Thanks,
Tom
>
> > + 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
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH 4/4] pcie/aspm: Remove CONFIG_PCIEASPM_* policy definitions
2026-04-29 18:06 [RFC PATCH 0/4] pcie/aspm: Enable all advertised ASPM states by default Thomas Falcon
` (2 preceding siblings ...)
2026-04-29 18:06 ` [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default Thomas Falcon
@ 2026-04-29 18:06 ` Thomas Falcon
3 siblings, 0 replies; 7+ messages in thread
From: Thomas Falcon @ 2026-04-29 18:06 UTC (permalink / raw)
To: Bjorn Helgaas, Rafael J . Wysocki
Cc: David E . Box, Lukas Wunner, Manivannan Sadhasivam, Len Brown,
linux-pci, linux-kernel, Thomas Falcon
ASPM policy now defaults to POLICY_POWER_SUPERSAVE for new systems
and POLICY_DEFAULT for others while allowing the user to change
policy using the existing pcie_aspm module parameter. Safely remove
CONFIG_PCIEASPM_* policy settings.
Suggested-by: David E. Box <david.e.box@linux.intel.com>
Signed-off-by: Thomas Falcon <thomas.falcon@intel.com>
---
Documentation/arch/x86/amd-debugging.rst | 5 ++--
arch/mips/configs/bmips_stb_defconfig | 1 -
arch/mips/configs/loongson2k_defconfig | 1 -
drivers/pci/pcie/Kconfig | 33 ------------------------
drivers/pci/pcie/aspm.c | 8 ------
5 files changed, 2 insertions(+), 46 deletions(-)
diff --git a/Documentation/arch/x86/amd-debugging.rst b/Documentation/arch/x86/amd-debugging.rst
index d92bf59d62c7..3f346a46357a 100644
--- a/Documentation/arch/x86/amd-debugging.rst
+++ b/Documentation/arch/x86/amd-debugging.rst
@@ -260,9 +260,8 @@ of the devices.
ASPM
----
For the best runtime power consumption, ASPM should be programmed as intended
-by the BIOS from the hardware vendor. To accomplish this the Linux kernel
-should be compiled with ``CONFIG_PCIEASPM_DEFAULT`` set to ``y`` and the
-sysfs file ``/sys/module/pcie_aspm/parameters/policy`` should not be modified.
+by the BIOS from the hardware vendor. To accomplish this the sysfs file
+``/sys/module/pcie_aspm/parameters/policy`` should not be modified.
Most notably, if L1.2 is not configured properly for any devices, the SoC
will not be able to enter the deepest idle state.
diff --git a/arch/mips/configs/bmips_stb_defconfig b/arch/mips/configs/bmips_stb_defconfig
index ecfa7f777efa..bb19073986a8 100644
--- a/arch/mips/configs/bmips_stb_defconfig
+++ b/arch/mips/configs/bmips_stb_defconfig
@@ -22,7 +22,6 @@ CONFIG_RD_XZ=y
# CONFIG_RD_LZ4 is not set
CONFIG_PCI=y
CONFIG_PCI_MSI=y
-CONFIG_PCIEASPM_POWERSAVE=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCIE_BRCMSTB=y
CONFIG_CPU_FREQ=y
diff --git a/arch/mips/configs/loongson2k_defconfig b/arch/mips/configs/loongson2k_defconfig
index ca534a6b66de..0a2c123eee69 100644
--- a/arch/mips/configs/loongson2k_defconfig
+++ b/arch/mips/configs/loongson2k_defconfig
@@ -88,7 +88,6 @@ CONFIG_RFKILL=m
CONFIG_RFKILL_INPUT=y
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
-CONFIG_PCIEASPM_PERFORMANCE=y
CONFIG_HOTPLUG_PCI=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
diff --git a/drivers/pci/pcie/Kconfig b/drivers/pci/pcie/Kconfig
index 207c2deae35f..069058870506 100644
--- a/drivers/pci/pcie/Kconfig
+++ b/drivers/pci/pcie/Kconfig
@@ -81,39 +81,6 @@ config PCIEASPM
When in doubt, say Y.
-choice
- prompt "Default ASPM policy"
- default PCIEASPM_DEFAULT
- depends on PCIEASPM
-
-config PCIEASPM_DEFAULT
- bool "BIOS default"
- depends on PCIEASPM
- help
- Use the BIOS defaults for PCI Express ASPM.
-
-config PCIEASPM_POWERSAVE
- bool "Powersave"
- depends on PCIEASPM
- help
- Enable PCI Express ASPM L0s and L1 where possible, even if the
- BIOS did not.
-
-config PCIEASPM_POWER_SUPERSAVE
- bool "Power Supersave"
- depends on PCIEASPM
- help
- Same as PCIEASPM_POWERSAVE, except it also enables L1 substates where
- possible. This would result in higher power savings while staying in L1
- where the components support it.
-
-config PCIEASPM_PERFORMANCE
- bool "Performance"
- depends on PCIEASPM
- help
- Disable PCI Express ASPM L0s and L1, even if the BIOS enabled them.
-endchoice
-
config PCIE_PME
def_bool y
depends on PCIEPORTBUS && PM
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
index 1c81e2f2e589..112904a75a4c 100644
--- a/drivers/pci/pcie/aspm.c
+++ b/drivers/pci/pcie/aspm.c
@@ -258,15 +258,7 @@ static LIST_HEAD(link_list);
#define POLICY_POWERSAVE 2 /* high power saving */
#define POLICY_POWER_SUPERSAVE 3 /* possibly even more power saving */
-#ifdef CONFIG_PCIEASPM_PERFORMANCE
-static int aspm_policy = POLICY_PERFORMANCE;
-#elif defined CONFIG_PCIEASPM_POWERSAVE
-static int aspm_policy = POLICY_POWERSAVE;
-#elif defined CONFIG_PCIEASPM_POWER_SUPERSAVE
-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;
--
2.43.0
^ permalink raw reply related [flat|nested] 7+ messages in thread