Message ID | 20180713063106.12995-2-acelan.kao@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | SATA device is not going to DEVSLP | expand |
On 07/13/2018 02:31 PM, AceLan Kao wrote: > From: Srinivas Pandruvada <srinivas.pandruvada@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. > Reference: > https://www.intel.com/content/dam/www/public/us/en/documents/datasheets > /332995-skylake-i-o-platform-datasheet-volume-1.pdf > Section 28.7.6.1 > > 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@linux.intel.com> > Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Was it reviewed by rafael? I didn't find the reply email on lkml, could you post the link? Please add: Link: https://patchwork.kernel.org/patch/XXX in each commit, your signed-off too. > --- > drivers/ata/libahci.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c > index a0de7a38430c..40d8dcd175e3 100644 > --- a/drivers/ata/libahci.c > +++ b/drivers/ata/libahci.c > @@ -2145,6 +2145,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) | > -- 2.17.1 > -- kernel-team mailing list kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team >
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index a0de7a38430c..40d8dcd175e3 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2145,6 +2145,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) |