[PATCH 2/5][SRU][B] ata: libahci: Correct setting of DEVSLP register

AceLan Kao acelan.kao at canonical.com
Wed Nov 28 09:19:27 UTC 2018

From: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>

BugLink: https://bugs.launchpad.net/bugs/1781533

We have seen that on some platforms, SATA device never show any DEVSLP
residency. This prevent power gating of SATA IP, which prevent system
to transition to low power mode in systems with SLP_S0 aka modern
standby systems. The PHY logic is off only in DEVSLP not in slumber.

Here driver is trying to do read-modify-write the devslp register. But
not resetting the bits for which this driver will modify values (DITO,
MDAT and DETO). So simply reset those bits before updating to new values.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada at linux.intel.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Signed-off-by: Tejun Heo <tj at kernel.org>
(cherry picked from commit 2dbb3ec29a6c069035857a2fc4c24e80e5dfe3cc)
Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
 drivers/ata/libahci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index edaba13edeb9..0a2938e4c834 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -2149,6 +2149,8 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
 		deto = 20;
+	/* Make dito, mdat, deto bits to 0s */
+	devslp &= ~GENMASK_ULL(24, 2);
 	devslp |= ((dito << PORT_DEVSLP_DITO_OFFSET) |
 		   (mdat << PORT_DEVSLP_MDAT_OFFSET) |
 		   (deto << PORT_DEVSLP_DETO_OFFSET) |

More information about the kernel-team mailing list