diff mbox series

[2/3] ata: ahci: Rename module parameter for lpm policy

Message ID 20220524170508.563-3-mario.limonciello@amd.com
State New
Headers show
Series Drop mobile board support | expand

Commit Message

Mario Limonciello May 24, 2022, 5:05 p.m. UTC
The LPM policy is applied to more chipsets than just mobile designs.
Update the module parameter to drop the word "mobile" to make this
clearer to users.

Also, document this renamed parameter in the admin-guide for users
as it was missing previously.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 Documentation/admin-guide/kernel-parameters.txt | 11 +++++++++++
 drivers/ata/ahci.c                              | 10 +++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)

Comments

Christoph Hellwig May 25, 2022, 9:03 a.m. UTC | #1
On Tue, May 24, 2022 at 12:05:07PM -0500, Mario Limonciello wrote:
> The LPM policy is applied to more chipsets than just mobile designs.
> Update the module parameter to drop the word "mobile" to make this
> clearer to users.
> 
> Also, document this renamed parameter in the admin-guide for users
> as it was missing previously.

Even if the name is confusing I don't think we should rename it as
that breaks existing setups.  I think just updating the documentation
is good enough, but if you feel strongly we can just add the new name
while keeping the old one as an alias.
Damien Le Moal May 25, 2022, 11:11 a.m. UTC | #2
On 5/25/22 18:03, Christoph Hellwig wrote:
> On Tue, May 24, 2022 at 12:05:07PM -0500, Mario Limonciello wrote:
>> The LPM policy is applied to more chipsets than just mobile designs.
>> Update the module parameter to drop the word "mobile" to make this
>> clearer to users.
>>
>> Also, document this renamed parameter in the admin-guide for users
>> as it was missing previously.
> 
> Even if the name is confusing I don't think we should rename it as
> that breaks existing setups.  I think just updating the documentation
> is good enough, but if you feel strongly we can just add the new name
> while keeping the old one as an alias.

+1 for the alias.

The other thing that this series need is to add the changes of the LPM
policy initialization according to the adapter capabilities (your patch
and the patches from Runa) as well as accounting for the eventual nolpm
link horkage flag. Otherwise, I fear that this change will generate many
regressions.
diff mbox series

Patch

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 9336d98fc670..9e6bd212004d 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -268,6 +268,17 @@ 
 			try_unsupported: try to drive unsupported chipsets
 				(may crash computer or cause data corruption)
 
+	ahci.lpm_policy= [AHCI]
+			The Default SATA Link Power Management (LPM) policy to use
+			for chipsets / "South Bridges" supporting low-power modes.
+
+			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
+
 	ALSA		[HW,ALSA]
 			See Documentation/sound/alsa-configuration.rst
 
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index c39cdf6a44f1..1e2febea2f28 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -640,9 +640,9 @@  static int marvell_enable = 1;
 module_param(marvell_enable, int, 0644);
 MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");
 
-static int mobile_lpm_policy = -1;
-module_param(mobile_lpm_policy, int, 0644);
-MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
+static int lpm_policy = -1;
+module_param(lpm_policy, int, 0644);
+MODULE_PARM_DESC(lpm_policy, "Default LPM policy");
 
 static void ahci_pci_save_initial_config(struct pci_dev *pdev,
 					 struct ahci_host_priv *hpriv)
@@ -1591,8 +1591,8 @@  static void ahci_update_initial_lpm_policy(struct ata_port *ap,
 	int policy = CONFIG_SATA_MOBILE_LPM_POLICY;
 
 	/* user modified policy via module param */
-	if (mobile_lpm_policy != -1) {
-		policy = mobile_lpm_policy;
+	if (lpm_policy != -1) {
+		policy = lpm_policy;
 		goto update_policy;
 	}