1. Article purpose[edit source]
The purpose of this article is to explain how to activate the PCIe ASPM.
ASPM (active-state power management) is a mechanism to progressively reduce power consumption thanks to the L0s/L1 substates.
- L0s (standby) only turnoff the controller transmit lane, but the link remains active.
- L1 the link becomes inactive, and a link recovery is needed to reactivate the link.
Linux allow 3 configuration mode for ASPM
- default: Use default settings specified by the firmware on the system.
- powersave: Sets ASPM to save power, regardless of the cost due to link recovery latency.
- performance: Sets ASPM to avoid PCIE link entering ASPM during idle times.
2. How to activate the power saving mode[edit source]
To change the PCIe ASPM to power save mode, first check that the PCIe endpoint Capability supports ASPM:
root@stm32mp2:~# lspci -vv -s 03:00.0 | grep ASPM LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 unlimited ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp- LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+
It's possible to dynamically change the policy either from the /sys/fs
root@stm32mp2:~# echo powersave > /sys/module/pcie_aspm/parameters/policy
or using the boot flag:
pcie_aspm.policy=powersave
root@stm32mp2:~# lspci -vv -s 03:00.0 | grep ASPM
LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 unlimited ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp- LnkCtl: ASPM L0s L1 Enabled; RCB 64 bytes, Disabled- CommClk+
Default config can be changed with
CONFIG_PCIEASPM_POWERSAVE=y