aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org> 2024-06-22 08:16:17 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2024-06-22 08:16:17 -0700
commitda3b6ef17658160ad59cbc56c3c1f8f9a38337bd (patch)
tree057be9bcc391a100b7dc93934e29e6d1bf959c99 /drivers
parentMerge tag 'pwm/for-6.10-rc5-fixes-take2' of git://git.kernel.org/pub/scm/linu... (diff)
parentata: ahci: Do not enable LPM if no LPM states are supported by the HBA (diff)
downloadlinux-da3b6ef17658160ad59cbc56c3c1f8f9a38337bd.tar.gz
linux-da3b6ef17658160ad59cbc56c3c1f8f9a38337bd.tar.bz2
linux-da3b6ef17658160ad59cbc56c3c1f8f9a38337bd.zip
Merge tag 'ata-6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fix from Niklas Cassel: - We currently enable DIPM (device initiated power management) in the device (using a SET FEATURES call to the device), regardless if the HBA supports any LPM states or not. It seems counter intuitive, and potentially dangerous to enable a device side feature, when the HBA does not have the corresponding support. Thus, make sure that we do not enable DIPM if the HBA does not support any LPM states. * tag 'ata-6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux: ata: ahci: Do not enable LPM if no LPM states are supported by the HBA
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 07d66d2c5f0d..5eb38fbbbecd 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1735,6 +1735,14 @@ static void ahci_update_initial_lpm_policy(struct ata_port *ap)
if (ap->pflags & ATA_PFLAG_EXTERNAL)
return;
+ /* If no LPM states are supported by the HBA, do not bother with LPM */
+ if ((ap->host->flags & ATA_HOST_NO_PART) &&
+ (ap->host->flags & ATA_HOST_NO_SSC) &&
+ (ap->host->flags & ATA_HOST_NO_DEVSLP)) {
+ ata_port_dbg(ap, "no LPM states supported, not enabling LPM\n");
+ return;
+ }
+
/* user modified policy via module param */
if (mobile_lpm_policy != -1) {
policy = mobile_lpm_policy;