linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: tj@kernel.org, hdegoede@redhat.com
Cc: rjw@rjwysocki.net, alan.cox@intel.com, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH 1/2] ata: libahci: Correct setting of DEVSLP register
Date: Mon,  2 Jul 2018 12:01:53 -0700	[thread overview]
Message-ID: <20180702190154.6864-2-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <20180702190154.6864-1-srinivas.pandruvada@linux.intel.com>

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>
---
 drivers/ata/libahci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 965842a08743..f6795d261869 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -2159,6 +2159,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

  reply	other threads:[~2018-07-02 19:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 19:01 [PATCH 0/2] ata: libahci: devslp fixes Srinivas Pandruvada
2018-07-02 19:01 ` Srinivas Pandruvada [this message]
     [not found]   ` <CAAtuYK9zXJHhJ8_aRqfqOPJJ9L29patDA9RuUs9r+GJVZMCy=Q@mail.gmail.com>
2018-07-17  3:43     ` [PATCH 1/2] ata: libahci: Correct setting of DEVSLP register Srinivas Pandruvada
2018-07-02 19:01 ` [PATCH 2/2] ata: libahci: Allow reconfigure " Srinivas Pandruvada
2018-07-30 15:15 ` [PATCH 0/2] ata: libahci: devslp fixes Srinivas Pandruvada
2018-07-30 15:22   ` Tejun Heo
2018-07-30 15:26     ` Hans de Goede
2018-07-30 17:33       ` Tejun Heo
2019-03-07 20:27         ` Gwendal Grignou
2019-03-07 20:37           ` Hans de Goede
2019-03-07 23:07             ` Rajat Jain
2019-03-08  0:04               ` Srinivas Pandruvada
2019-03-08  8:57                 ` Hans de Goede
2019-03-08 19:29                   ` Rajat Jain
2019-03-11  7:52                     ` Gwendal Grignou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180702190154.6864-2-srinivas.pandruvada@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=alan.cox@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).