Skip to contentSkip to conversation

Patch "ahci: Allow setting a default LPM policy for mobile chipsets" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 2 messages Feb 14, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ahci: Allow setting a default LPM policy for mobile chipsets

to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ahci-allow-setting-a-default-lpm-policy-for-mobile-chipsets.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From ebb82e3c79d2a956366d0848304a53648bd6350b Mon Sep 17 00:00:00 2001

From: Hans de Goede <[email protected]>
Date: Mon, 11 Dec 2017 17:52:16 +0100
Subject: ahci: Allow setting a default LPM policy for mobile chipsets

From: Hans de Goede <[email protected]>

commit ebb82e3c79d2a956366d0848304a53648bd6350b upstream.

On many laptops setting a different LPM policy then unknown / max_performance can lead to power-savings of 1.0 - 1.5 Watts (when idle).

Modern ultrabooks idle around 6W (at 50% screen brightness), 1.0 - 1.5W is a significant chunk of this.

There are some performance / latency costs to enabling LPM by default, so it is desirable to make it possible to set a different LPM policy for mobile / laptop variants of chipsets / "South Bridges" vs their desktop / server counterparts. Also enabling LPM by default is not entirely without risk of regressions. At least min_power is known to cause issues with some disks, including some reports of data corruption.

This commits adds a new ahci.mobile_lpm_policy kernel cmdline option, which defaults to a new SATA_MOBILE_LPM_POLICY Kconfig option so that Linux distributions can choose to set a LPM policy for mobile chipsets by default.

The reason to have both a kernel cmdline option and a Kconfig default value for it, is to allow easy overriding of the default to allow trouble-shooting without needing to rebuild the kernel.

---
 drivers/ata/Kconfig |   19 ++++++++++
 drivers/ata/ahci.c  |   97 ++++++++++++++++++++++++++++++----------------------
 drivers/ata/ahci.h  |    3 +
 3 files changed, 78 insertions(+), 41 deletions(-)
drivers/ata/Kconfig +19 -0
@@ -92,6 +92,25 @@ config SATA_AHCI
 
 	  If unsure, say N.
 
+config SATA_MOBILE_LPM_POLICY
+	int "Default SATA Link Power Management policy for mobile chipsets"
+	range 0 4
+	default 0
+	depends on SATA_AHCI
+	help
+	  Select the Default SATA Link Power Management (LPM) policy to use
+	  for mobile / laptop variants of chipsets / "South Bridges".
+
+	  The value set has the following meanings:
+		0 => Keep firmware settings
+		1 => Maximum performance
+		2 => Medium power
+		3 => Medium power with Device Initiated PM enabled
+		4 => Minimum power
+
+	  Note "Minimum power" is known to cause issues, including disk
+	  corruption, with some disks and should not be used.
+
 config SATA_AHCI_PLATFORM
 	tristate "Platform AHCI SATA support"
 	help
drivers/ata/ahci.c +56 -41

175 lines not on this page · raw message

drivers/ata/ahci.h +3 -0
@@ -251,6 +251,9 @@ enum {
 	AHCI_HFLAG_YES_ALPM		= (1 << 23), /* force ALPM cap on */
 	AHCI_HFLAG_NO_WRITE_TO_RO	= (1 << 24), /* don't write to read
 							only registers */
+	AHCI_HFLAG_IS_MOBILE		= (1 << 25), /* mobile chipset, use
+							SATA_MOBILE_LPM_POLICY
+							as default lpm_policy */
 
 	/* ap->flags bits */
 

Patches currently in stable-queue which might be from [email protected] are

queue-4.15/ahci-add-pci-ids-for-intel-bay-trail-cherry-trail-and-apollo-lake-ahci.patch queue-4.15/ahci-allow-setting-a-default-lpm-policy-for-mobile-chipsets.patch queue-4.15/ahci-annotate-pci-ids-for-mobile-intel-chipsets-as-such.patch

author maintainer
#1 lore raw
Quoted 8 lines · On Wed, Feb 14, 2018 at 03:26:17PM +0100, [email protected] wrote:

This is a note to let you know that I've just added the patch titled

ahci: Allow setting a default LPM policy for mobile chipsets

to the 4.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 7 lines

The filename of the patch is:
ahci-allow-setting-a-default-lpm-policy-for-mobile-chipsets.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Note, I added this patch to the stable trees, as I was backporting a new device id patch that was requested, and it was failing to apply due to this, and a few other, ahci patches from 4.15..4.16-rc1. It seems "small" enough, and battery savings is always a good thing, so I figured it was good enough to backport. Unless someone objects?

thanks,

greg k-h