NOTE: this page is for archival only, see the note at the end of the page.

Go back –> Documentation

ASPM on Linux

This section is a review of ASPM and the Linux tweaks/debugging utilities available for testing ASPM. I can't find another wiki to place this in yet on, it should be moved eventually.

ASPM review

ASPM is a PCI-E enhancement. It allows for a device to go completely electrically idle, meaning it will not send or receive electrical signals for a while. To achieve this the PCI-E specification has come up with instructions a PCI-E endpoint (device) should follow for signaling to a root complex (the bus) that it is going idle, or waking up. Communication at the PCI bus can be tricky to align with an endpoint and because of this there are patterns a PCI device will use to train the link to come out of electrical idle states. There are several states a device will enter when using ASPM, namely L1, L0s.

The way it typically works internally on endpoints (devices) is that there are idle timers (counters) in the chipset. There is a set point at which the PCIe link is idle enough to enter L0s, and a second point at which we're idle enough to enter L1. A device could potentially 'support' L0s but internally the timers could be set such that L0s and L1 happen at the same time or L0s happens after L1, so the link will essentially never enter L0s. ASPM compliance may vary by device, ASPM specification has varied as new releases have been made.

ASPM for 802.11

Testing on battery lifetime shows that the difference between having L1 and L1/L0s both could at max save up to five minutes of battery life in the best possible scenario where the 802.11 link is the most idle. This comes right down to the frequency the driver is accessing registers on the chip.

Linux kernel ASPM support

An Operating System should not need to muck with ASPM, the BIOS would have dealt with the capability exchanges between the root complex and the different endpoints. Of course, BIOSes are buggy though – so the Linux kernel does have the capability to oversee and review the capabilities by itself and overrule the BIOS. ASPM support in the Linux kernel is also used to expose ASPM capabilities for PCIE devices to userspace (need confirmation, I see this being done in the code, but makes no sense).

You can also muck with ASPM settings to debug root complex/endpoints. This is a feature which should *not* be used by the average user, this is designed more for developers, choosing the wrong parameters can damage your device.

The option to debug ASPM is available through the CONFIG_PCIEASPM kernel configuration:

        bool "PCI Express ASPM support(Experimental)"
        depends on PCI && EXPERIMENTAL && PCIEPORTBUS
        default n
          This enables PCI Express ASPM (Active State Power Management) and
          Clock Power Management. ASPM supports state L0/L0s/L1.

          When in doubt, say N.

Enabling this will compile drivers/pci/pcie/aspm.c

Force enable or disable ASPM

This boot parameter is available:

        pcie_aspm=      [PCIE] Forcibly enable or disable PCIe Active State Power
                off     Disable ASPM.
                force   Enable ASPM even on devices that claim not to support it.
                        WARNING: Forcing ASPM on may cause system lockups.

802.11 ASPM device tweaks

Devices are typically not expected to have to do anything for ASPM but some tuning can be done on the PCI-E devices to reprogram L0s/L1 entrance and exit latency timers, the number of FTS packets we send to exit L0s, amongst other things.

This is a static dump of the wiki, taken after locking it in January 2015. The new wiki is at
versions of this page: last, v17, v16, v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1