From: sashiko-bot@kernel.org
To: "Krishna Chaitanya Chundru" <krishna.chundru@oss.qualcomm.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v6 3/3] PCI/ASPM: Mask ASPM states based on Devicetree properties
Date: Mon, 27 Jul 2026 14:16:57 +0000 [thread overview]
Message-ID: <20260727141657.7E31F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727-aspm-v6-3-2ebb3ee7ef71@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Hardware ASPM state becomes desynchronized from the software-tracked `link->aspm_enabled` state on links where firmware forced ASPM L0s/L1 on despite missing hardware capabilities, breaking sysfs reporting.
--
--- Patch [3]: [PATCH v6 3/3] PCI/ASPM: Mask ASPM states based on Devicetree properties ---
commit d3ca900c30e202e8adf6acdf7daf494224ae2179
Author: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
PCI/ASPM: Mask ASPM states based on Devicetree properties
This commit introduces Devicetree property checks to selectively disable ASPM
states based on hardware constraints. It moves the default state override
evaluation earlier in capability initialization and ensures that states disabled
by Devicetree are explicitly cleared from the hardware configuration during the
L0s/L1 restore phase.
Link [1]: https://github.com/devicetree-org/dt-schema/pull/188
Link [2]: https://github.com/devicetree-org/dt-schema/pull/190
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 544f35bb25554..0a671825fac8d 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
[ ... ]
> @@ -926,9 +999,25 @@ static void pcie_aspm_cap_init(struct pcie_link_state *link, int blacklist)
>
> aspm_l1ss_init(link);
>
> - /* Restore L0s/L1 if they were enabled */
> + /* Save default state */
> + link->aspm_default = link->aspm_enabled;
> +
> + pcie_aspm_override_default_link_state(link);
> +
> + /*
> + * Restore L0s/L1 if they were enabled, but don't restore any
> + * state a Devicetree override just disabled in aspm_support above.
> + */
> if (FIELD_GET(PCI_EXP_LNKCTL_ASPMC, child_lnkctl) ||
> FIELD_GET(PCI_EXP_LNKCTL_ASPMC, parent_lnkctl)) {
> + if (!(link->aspm_support & PCIE_LINK_STATE_L0S)) {
> + child_lnkctl &= ~PCI_EXP_LNKCTL_ASPM_L0S;
> + parent_lnkctl &= ~PCI_EXP_LNKCTL_ASPM_L0S;
> + }
> + if (!(link->aspm_support & PCIE_LINK_STATE_L1)) {
> + child_lnkctl &= ~PCI_EXP_LNKCTL_ASPM_L1;
> + parent_lnkctl &= ~PCI_EXP_LNKCTL_ASPM_L1;
> + }
[Severity: Medium]
If firmware forced ASPM L0s or L1 on despite missing hardware capabilities,
this block will correctly strip those unsupported bits before writing back to
hardware. However, does this leave the software state desynchronized?
Earlier during initialization, link->aspm_enabled captures the original
firmware settings. Since this restore block now selectively clears unsupported
bits from the hardware write but doesn't synchronize those changes back to
link->aspm_enabled, won't sysfs attributes and pcie_aspm_enabled() incorrectly
report these states as active?
Could this lead to incorrect sysfs reporting until pci_enable_device()
eventually triggers a heal of the state via pcie_config_aspm_link()?
> pcie_capability_clear_and_set_word(parent, PCI_EXP_LNKCTL,
> PCI_EXP_LNKCTL_ASPMC,
> parent_lnkctl & PCI_EXP_LNKCTL_ASPMC);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260727-aspm-v6-0-2ebb3ee7ef71@oss.qualcomm.com?part=3
prev parent reply other threads:[~2026-07-27 14:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 14:02 [PATCH v6 0/3] PCI/ASPM: Mask ASPM states based on Devicetree properties Krishna Chaitanya Chundru
2026-07-27 14:02 ` [PATCH v6 1/3] PCI/ASPM: Use pcie_capability_clear_and_set_word() for ASPM disable/restore Krishna Chaitanya Chundru
2026-07-27 14:11 ` sashiko-bot
2026-07-27 14:02 ` [PATCH v6 2/3] PCI/ASPM: Disable/restore ASPM on every function for multi-function devices Krishna Chaitanya Chundru
2026-07-27 14:15 ` sashiko-bot
2026-07-27 14:02 ` [PATCH v6 3/3] PCI/ASPM: Mask ASPM states based on Devicetree properties Krishna Chaitanya Chundru
2026-07-27 14:16 ` sashiko-bot [this message]
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=20260727141657.7E31F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=krishna.chundru@oss.qualcomm.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.