public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Thomas Falcon <thomas.falcon@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	 "Rafael J . Wysocki" <rafael@kernel.org>,
	 "David E . Box" <david.e.box@linux.intel.com>,
	 Lukas Wunner <lukas@wunner.de>,
	 Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
	 Len Brown <lenb@kernel.org>,
	linux-pci@vger.kernel.org,  LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default
Date: Thu, 30 Apr 2026 13:17:05 +0300 (EEST)	[thread overview]
Message-ID: <dfff52bc-06ad-0531-f28a-72804620c072@linux.intel.com> (raw)
In-Reply-To: <20260429180647.197072-4-thomas.falcon@intel.com>

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.


  reply	other threads:[~2026-04-30 10:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [RFC PATCH 3/4] pcie/aspm: Enable all hardware power-saving states by default Thomas Falcon
2026-04-30 10:17   ` Ilpo Järvinen [this message]
2026-04-30 22:19     ` Falcon, Thomas
2026-04-29 18:06 ` [RFC PATCH 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=dfff52bc-06ad-0531-f28a-72804620c072@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=david.e.box@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 \
    --cc=thomas.falcon@intel.com \
    /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