From: sashiko-bot@kernel.org
To: "Thomas Falcon" <thomas.falcon@intel.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [RFC PATCH v2 1/4] pcie/aspm: Add debug logging for aspm policy config
Date: Wed, 13 May 2026 00:25:25 +0000 [thread overview]
Message-ID: <20260513002525.8FEEBC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260511210936.562622-2-thomas.falcon@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] Dead code when attempting to log Clock PM state in ASPM debug output.
- [Low] Unconditional and potentially misleading debug logging for ASPM link configuration.
--
commit 364db9458a74bb3fb257b69effddd2f95f805170
Author: Thomas Falcon <thomas.falcon@intel.com>
pcie/aspm: Add debug logging for aspm policy config
Include additional logging for ASPM and Clock PM state changes
keeping track of code flow and enabled power saving states.
> diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
> index 925373b98dff0..cd23c1462502f 100644
> --- a/drivers/pci/pcie/aspm.c
> +++ b/drivers/pci/pcie/aspm.c
[ ... ]
> @@ -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);
> }
Are these debug statements being printed more often than intended?
Since these prints happen unconditionally before the early return check:
if (link->aspm_enabled == state)
return;
enabling dynamic debugging will output these messages even if the device
states already match the requested state and no hardware configuration is
actually applied.
[ ... ]
> @@ -997,16 +1005,34 @@ static void pcie_config_aspm_link(struct pcie_link_state *link, u32 state)
[ ... ]
> + 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"));
Is it possible for the CLKPM flag to ever be true here?
It looks like the PCIE_LINK_STATE_CLKPM bit is masked out earlier in the
function when verifying capabilities:
state &= (link->aspm_capable & ~link->aspm_disable);
Since the CLKPM bit is outside the 7-bit range of aspm_capable, this bit
is never present in the state mask at this point, so the macro will always
evaluate to an empty string.
Because the Clock PM state change is already correctly logged in
pcie_set_clkpm(), does this FLAG check need to be included here?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260511210936.562622-1-thomas.falcon@intel.com?part=1
next prev parent reply other threads:[~2026-05-13 0:25 UTC|newest]
Thread overview: 9+ 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-13 0:25 ` sashiko-bot [this message]
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-13 0:40 ` sashiko-bot
2026-05-11 21:09 ` [RFC PATCH v2 3/4] pcie/aspm: Enable all hardware power-saving states by default Thomas Falcon
2026-05-13 1:15 ` sashiko-bot
2026-05-11 21:09 ` [RFC PATCH v2 4/4] pcie/aspm: Remove CONFIG_PCIEASPM_* policy definitions Thomas Falcon
2026-05-13 1:54 ` sashiko-bot
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=20260513002525.8FEEBC2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--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