Skip to contentSkip to conversation

ata: ahci: Enable/Disable ATA Staggered Spin-up by default

PATCH In review Eric Curtin 2 participants 4 messages Sep 19, 2022 – Sep 20, 2022 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: ahci: Enable/Disable ATA Staggered Spin-up by default

On some kernels tuned for performance, you want to always favour spin-up time versus power draw. This adds the ability to always favour spin-up time by default (disabling Staggered Spin-up favours performance, rather than power draw).

Regardless of whether this is enabled or disabled the libahci.ignore_sss option will override any kernel config.

---
 drivers/ata/Kconfig   | 15 +++++++++++++++
 drivers/ata/libahci.c |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/ata/Kconfig +15 -0
index 1c9f4fb2595d..36b11fbcf644 100644
@@ -67,6 +67,21 @@ config ATA_FORCE
 
 	  If unsure, say Y.
 
+config ATA_SSS
+        bool "Enable ATA Staggered Spin-up by default"
+        default y
+        help
+          This option denotes whether Staggered Spin-up capability on
+          storage controllers is used. Staggered Spin-up reduces
+          peak power draw, but decreases performance. If this config is
+          set to N, Staggered Spin-up capability will be ignored by
+          default.
+
+          This can be overridden by using the kernel argument
+          libahci.ignore_sss.
+
+          If unsure, say Y.
+
 config ATA_ACPI
 	bool "ATA ACPI Support"
 	depends on ACPI
drivers/ata/libahci.c +1 -1
index cf8c7fd59ada..b7b573d47fda 100644
@@ -33,7 +33,7 @@
 #include "libata.h"
 
 static int ahci_skip_host_reset;
-int ahci_ignore_sss;
+int ahci_ignore_sss = !IS_ENABLED(CONFIG_ATA_SSS);
 EXPORT_SYMBOL_GPL(ahci_ignore_sss);
 
 module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444);
Signature · 1 line
2.37.3
#1 lore raw

Err, no. We should not add config options for every damn default. If you want to force it on CONFIG_CMDLINE is your friend.

#2 lore raw

The libahci.ignore_sss flag is something that is set by a number of performance focused distros. The motivation behind this is to set ignore_sss in a boolean fashion at compile time rather than depend on cmdline parsing.

Quoted 4 lines · Christoph Hellwig

Err, no. We should not add config options for every damn default. If you want to force it on CONFIG_CMDLINE is your friend.

#3 lore raw
Quoted 4 lines · Eric Curtin

The libahci.ignore_sss flag is something that is set by a number of performance focused distros. The motivation behind this is to set ignore_sss in a boolean fashion at compile time rather than depend on cmdline parsing.

So set it in CONFIG_CMDLINE if you want it enabled at compile time. The whole point of a built-in command line is to not add another Kconfig option for every bloody option that someone wants a default for.