Skip to content

Commit 73ae7e1

Browse files
committed
ata: libata-sata: improve sysfs description for ATA_LPM_UNKNOWN
Currently, both ATA_LPM_UNKNOWN (0) and ATA_LPM_MAX_POWER (1) displays as "max_performance" in sysfs. This is quite misleading as they are not the same. For ATA_LPM_UNKNOWN, ata_eh_set_lpm() will not be called at all, leaving the configuration in unknown state. For ATA_LPM_MAX_POWER, ata_eh_set_lpm() is called, and setting the policy to ATA_LPM_MAX_POWER. This also matches the description of the SATA_MOBILE_LPM_POLICY Kconfig: 0 => Keep firmware settings 1 => Maximum performance Thus, update the sysfs description for ATA_LPM_UNKNOWN to match reality. While at it, update libata.h to mention that the ascii descriptions are in libata-sata.c and not in libata-scsi.c. Reviewed-by: Damien Le Moal <[email protected]> Signed-off-by: Niklas Cassel <[email protected]>
1 parent 6613476 commit 73ae7e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/ata/libata-sata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ bool sata_lpm_ignore_phy_events(struct ata_link *link)
784784
EXPORT_SYMBOL_GPL(sata_lpm_ignore_phy_events);
785785

786786
static const char *ata_lpm_policy_names[] = {
787-
[ATA_LPM_UNKNOWN] = "max_performance",
787+
[ATA_LPM_UNKNOWN] = "keep_firmware_settings",
788788
[ATA_LPM_MAX_POWER] = "max_performance",
789789
[ATA_LPM_MED_POWER] = "medium_power",
790790
[ATA_LPM_MED_POWER_WITH_DIPM] = "med_power_with_dipm",

include/linux/libata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ enum ata_completion_errors {
471471

472472
/*
473473
* Link power management policy: If you alter this, you also need to
474-
* alter libata-scsi.c (for the ascii descriptions)
474+
* alter libata-sata.c (for the ascii descriptions)
475475
*/
476476
enum ata_lpm_policy {
477477
ATA_LPM_UNKNOWN,

0 commit comments

Comments
 (0)