SATA Link Power Management

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

SATA Link Power Management (LPM) puts the physical layer (PHY) of the SATA link into a power saving state. SATA Link Power Management is independent of the power state of the hard disk or SSD. This is controlled at the ATA protocol level and, in the case of hard disks for example, leads to a spinning down of the data carrier in order to save power. SATA LPM has led to a significant reduction in the overall power consumption of the SATA subsystem, both in the platform controller hub (SATA controller in the chipset or CPU) and in the SATA device itself. However, LPM is not compatible with hot-plug

Link Power Management States

The paper Designing Energy Efficient SATA Devices[1] from Intel explains the basics of SATA link power management.

SATA connections can be in one of three power management states:

  • Active
  • Partial (max. 10 µs return latency): Partial is designed to allow power state transitions to be continuous with minimal impact on performance.
  • Slumber (max. 10 ms return latency): Slumber allows for greater power savings with its longer return latency. Slumber should only be used when the SATA connection is expected to be inactive for an extended period of time.

Host- and Device-Initiated Power Management

SATA Link Power Management can be divided into two areas:

  • Host-Initiated Link Power Management (HIPM) and
  • Device-Initiated Link Power Management (DIPM)

SATA link power management requires cooperation between the host and the device. Both the host and the device can request the link to change to a low-power state. The appropriate host or device must then accept or reject the request to change the link state. Each of these methods provides energy savings in isolation. However, maximum energy savings are achieved when both procedures are used.

Activate SATA LPM

  • Windows (since Windows 7):
    • The Intel RST driver activates LPM
    • Alternatively, HIPM and DIPM can be enabled for the Windows SATA standard driver via a script:[2][3]
    • By default, Microsoft’s in-box SATA driver (StorAHCI) activates "HIPM-only"[4][5][6]
  • Linux:
    • Activation at runtime (here in the example for the SATA controller host0):
      # echo "med_power_with_dipm" > /sys/class/scsi_host/host0/link_power_management_policy
    • Two prerequisites must be met for automatic activation already during the startup process:
      1. The corresponding SATA controller must be declared as board_ahci_low_power[7] in the Linux source code in the table pci_device_id ahci_pci_tbl.[8]
      2. The SATA Link Power Management Policy must be set to "3 - Medium power with Device Initiated PM enabled".[9] This is possible in two ways:
        • Kernel compile-time parameter CONFIG_SATA_MOBILE_LPM_POLICY=3
        • Kernel boot parameter ahci.mobile_lpm_policy=3
  • FreeBSD / OPNsense:

Hot-Plug Einschränkungen

Enabled Link Power Management places the SATA link in a neutral logical state. Because the signal lines are in a neutral logical state, it is impossible for an AHCI host controller to detect when a SATA device has been removed from the bus.

Server systems with backplane and SATA hot-plugging support should therefore have SATA Link Power Management disabled for reliable hot-plugging.[10] See also AMD EPYC Server with Ubuntu - Enable SATA Hot-Swap.

Example LES v4

Test setup of a LES v4 (Elkhart Lake J6412 CPU). Example shows power usage without SATA LPM.

The following example of a LES v4 (Elkhart Lake J6412 CPU) shows possible energy savings and temperature reductions by activated SATA Link Power Management.

The following configuration is used:

  • BIOS Version: Date 11/21/2022
  • RAM: 4 GB ATP DDR4-3200 S0-DIMM (X4G04QC6BNWEMO-7-TO1)
  • Headless operation (no monitor, keyboard, mouse attached) with one active NIC link (1 Gbit/s)
  • OS: Debian 12 (without Desktop/GNOME, with OpenSSH Server) using Linux Kernel 6.1.0-9-amd64 (Debian 6.1.27-1 2023-05-08)
SSD max_performance med_power_with_dipm Difference
Manufacturer Family Model Capacity

[GB]

Controller Firmware Idle Power

[Watt]

Temp 1[note 1]

[°C]

Temp 2[note 2]

[°C]

Idle Power

[Watt]

Temp 1

[°C]

Temp 2

[°C]

Idle Power

[Watt]

Temp 1

[°C]

Temp 2

[°C]

ATP A600Sc AF120GSTIC-T22 (M.2 2280) 120 Silicon Motion SM2259H T0205B 8.0 - 8.3 56 74 6.2 - 6.6 44 44 ~ 1.8 12 30
AF120GSTCJ-T22 (2.5") 7.7 - 8.4 42 52 6.1 - 7.1 36 36 ~ 1.6 6 16
AF480GSTIA-T22 (M.2 2242) 480 7.9 - 8.5 66 67 6.2 - 6.6 46 46 ~ 1.8 20 21
A600Vc AF128GSTIC-TM2 (M.2) 128 Phison PS3111-S11-13 SBFMT1.3 7.4 - 8.0 33 - 5.8 - 6.6 33 - ~ 1.4 0 -
Intel / Solidigm D3-S4520 SSDSC2KB240GZ 240 7CV10111 8.5 - 9.3 56 - 8.5 - 9.3 53 - 0 0 - 3 -
Samsung 850 PRO MZ-7KE512BW 512 Samsung MEX S4LN045X01-803 EXM04B6Q 7.5 - 7.9 41 - 6.0 - 6.9 34 - ~ 1.3 6 -
PM893 MZ7L3240HCHQ-00A07 240 Samsung JXTC304Q 8.6 - 9.7 55 - 8.6 - 9.7 55 - 0 0 -

Ambient temperature: 22.8 - 25.3 °C

Note: when using a 16 GB RAM module (ATP X4G16QA8BVWESO-7-TO1) instead of the 4 GB RAM module listed above, the power consumption increases by approx. 0.2 - 0.3 watts in idle mode.

Footnotes:

  1. Temperature of the SSD, SATA Attribute ID 190 and/or 194
  2. Temperature of the SATA Controller chips of the SSD, SATA Attribute ID 231

Changing the setting at runtime

Since the SATA controller (Intel Corporation Elkhart Lake SATA AHCI [8086:4b63]) is not declared as board_ahci_low_power in ahci.c up to Linux Kernel 6.5, SATA Link Power Management was activated at runtime during the tests:

# echo "med_power_with_dipm" > /sys/class/scsi_host/host0/link_power_management_policy

Kernel Support

As of Linux kernel version 6.6, the SATA controller (Intel Corporation Elkhart Lake SATA AHCI [8086:4b63]) is declared as board_ahci_low_power.[11][12] Via Linux LTS kernel the patch was also integrated into the following subreleases:

Kernel Version Patch included since Patch
6.6 6.6-rc1 commit
6.5 6.5.4 commit
6.1 6.1.54 commit
5.15 5.15.134 commit
5.10 Patch in Queue

References

  1. Designing Energy Efficient SATA Devices - Overview and Implementation Recommendations (www.intel.com, April 2011)
  2. Tipps & Tricks - Intel-RST- oder MS-AHCI-Treiber für SATA? (c't 24/2016)
  3. Link power management mode - HIPM/DIPM (learn.microsoft.com)
  4. SATA/AHCI (learn.microsoft.com) By default, HIPM-only is enabled and StorAHCI manages Partial to Slumber transitions.
  5. Link power management mode - HIPM/DIPM (learn.microsoft.com)
  6. What do HIPM/DIPM modes means in AHCI link power management settings? (answers.microsoft.com)
  7. drivers/ata/ahci.c - board_ahci_low_power (git.kernel.org - Kernel 6.1)
  8. drivers/ata/ahci.c - pci_device_id ahci_pci_tbl (git.kernel.org - Kernel 6.1)
  9. drivers/ata/Kconfig - SATA_MOBILE_LPM_POLICY (git.kernel.org - Kernel 6.1)
  10. Serial ATA Advanced Host Controller Interface (AHCI) Revision 1.1 (www.intel.com) 7.3.1.1 Software Flow for Hot Plug Removal Detection - To reliably detect hot plug removals, software must disable interface power management.
  11. (PATCH v2) ata: ahci: Add Elkhart Lake AHCI controller (linux-ide Mailing List, Werner Fischer, 29.08.2023)
  12. (GIT PULL) ata changes for 6.6-rc1 (linux-ide Mailing List, Damien Le Moal, 05.09.2023)


Foto Werner Fischer.jpg

Author: Werner Fischer

Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.


Related articles

M.2 and mSATA SSD Support of Thomas-Krenn Servers
SATA exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen
Security advisory for Kr00k WiFi vulnerability CVE-2019-15126