Re: [PATCH v6 2/3] PCI/ASPM: Disable/restore ASPM on every function for multi-function devices

Manivannan Sadhasivam <[email protected]>
Newsgroups org.kernel.vger.linux-pci,org.kernel.vger.linux-kernel
Message-ID <oexbxvtxozvqw5kwv34skbv2ipumrkgjnrla6gferpdtwjdma3@sqxkfr2fpvql>
On Mon, Jul 27, 2026 at 07:32:37PM +0530, Krishna Chaitanya Chundru wrote:
> pcie_aspm_cap_init() disables ASPM L0s/L1 before touching L1SS config,
> then restores the pre-existing state afterward. Both steps only ever
> touched link->downstream, i.e. function 0 of the downstream component,
> leaving sibling functions (>0) on a multi-function device untouched.
> 
> This means the "disable" step does not actually disable ASPM link-wide
> on a multi-function device: a sibling function can still have L1
> enabled even after this step runs. PCIe r6.2 sec 7.5.3.7 recommends
> programming the same ASPM Control value for all functions of a
> multi-function device, and pcie_config_aspm_link() already loops over
> every function on the bus for exactly this reason.
> 
> Loop over every function on linkbus->devices for both the disable and
> restore steps, keeping the existing PCIe r6.2 sec 7.5.3.7 ordering
> (disable downstream functions before upstream, restore upstream before
> downstream functions). The masked pcie_capability_clear_and_set_word()
> accessor from the previous commit makes this safe: it only ever
> touches the ASPM Control bits, so function-specific bits elsewhere in
> LNKCTL (e.g. Read Completion Boundary, CLKREQ Enable) on sibling
> functions are left untouched.
> 
> Fixes: 7447990137bf ("PCI/ASPM: Disable L1 before disabling L1 PM Substates")

Reported-by: Sashiko <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/

> Signed-off-by: Krishna Chaitanya Chundru <[email protected]>

Reviewed-by: Manivannan Sadhasivam <[email protected]>

- Mani

-- 
மணிவண்ணன் சதாசிவம்
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.