Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628671 > unrolled thread

[PATCH 0/3] nvme: APST improvements (for 4.12, perhaps)

Started byAndy Lutomirski <luto@kernel.org>
First post2017-04-22 01:20 +0200
Last post2017-04-23 10:20 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] nvme: APST improvements (for 4.12, perhaps) Andy Lutomirski <luto@kernel.org> - 2017-04-22 01:20 +0200
    [PATCH 1/3] nvme: Fix APST comment Andy Lutomirski <luto@kernel.org> - 2017-04-22 01:30 +0200
      Re: [PATCH 1/3] nvme: Fix APST comment Christoph Hellwig <hch@lst.de> - 2017-04-23 10:20 +0200
    [PATCH 3/3] nvme: Add nvme_core.force_apst to ignore the NO_APST quirk Andy Lutomirski <luto@kernel.org> - 2017-04-22 01:30 +0200
      Re: [PATCH 3/3] nvme: Add nvme_core.force_apst to ignore the         NO_APST quirk Christoph Hellwig <hch@lst.de> - 2017-04-23 10:20 +0200

#1628671 — [PATCH 0/3] nvme: APST improvements (for 4.12, perhaps)

FromAndy Lutomirski <luto@kernel.org>
Date2017-04-22 01:20 +0200
Subject[PATCH 0/3] nvme: APST improvements (for 4.12, perhaps)
Message-ID<tyQ0h-3xb-9@gated-at.bofh.it>
Hi all-

These are APST improvements for 4.12 or so.  The first one fixes a
buggy comment.  The second makes debugging easier.  The third makes
it possible to force APST on despite quirks.

Andy Lutomirski (3):
  nvme: Fix APST comment
  nvme: Display raw APST configuration via DYNAMIC_DEBUG
  nvme: Add nvme_core.force_apst to ignore the NO_APST quirk

 drivers/nvme/host/core.c | 38 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 36 insertions(+), 2 deletions(-)

-- 
2.9.3

[toc] | [next] | [standalone]


#1628681 — [PATCH 1/3] nvme: Fix APST comment

FromAndy Lutomirski <luto@kernel.org>
Date2017-04-22 01:30 +0200
Subject[PATCH 1/3] nvme: Fix APST comment
Message-ID<tyQ9Y-3Ad-7@gated-at.bofh.it>
In reply to#1628671
There was a typo in the description of the timeout heuristic.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index eeb409c287b8..b0c692a14e9b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1267,7 +1267,7 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
 	 * heuristic: we are willing to spend at most 2% of the time
 	 * transitioning between power states.  Therefore, when running
 	 * in any given state, we will enter the next lower-power
-	 * non-operational state after waiting 100 * (enlat + exlat)
+	 * non-operational state after waiting 50 * (enlat + exlat)
 	 * microseconds, as long as that state's total latency is under
 	 * the requested maximum latency.
 	 *
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1628927 — Re: [PATCH 1/3] nvme: Fix APST comment

FromChristoph Hellwig <hch@lst.de>
Date2017-04-23 10:20 +0200
SubjectRe: [PATCH 1/3] nvme: Fix APST comment
Message-ID<tzkUq-5Yo-9@gated-at.bofh.it>
In reply to#1628681
On Fri, Apr 21, 2017 at 04:19:22PM -0700, Andy Lutomirski wrote:
> There was a typo in the description of the timeout heuristic.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

[toc] | [prev] | [next] | [standalone]


#1628682 — [PATCH 3/3] nvme: Add nvme_core.force_apst to ignore the NO_APST quirk

FromAndy Lutomirski <luto@kernel.org>
Date2017-04-22 01:30 +0200
Subject[PATCH 3/3] nvme: Add nvme_core.force_apst to ignore the NO_APST quirk
Message-ID<tyQ9X-3Ad-5@gated-at.bofh.it>
In reply to#1628671
We're probably going to be stuck quirking APST off on an over-broad
range of devices for 4.11.  Let's make it easy to override the quirk
for testing.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 drivers/nvme/host/core.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 05ba4f8bb73b..5249027a76ca 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -62,6 +62,10 @@ module_param(default_ps_max_latency_us, ulong, 0644);
 MODULE_PARM_DESC(default_ps_max_latency_us,
 		 "max power saving latency for new devices; use PM QOS to change per device");
 
+static bool force_apst;
+module_param(force_apst, bool, 0644);
+MODULE_PARM_DESC(force_apst, "allow APST for newly enumerated devices even if quirked off");
+
 static LIST_HEAD(nvme_ctrl_list);
 static DEFINE_SPINLOCK(dev_list_lock);
 
@@ -1504,6 +1508,11 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
 		}
 	}
 
+	if (force_apst && (ctrl->quirks & NVME_QUIRK_NO_DEEPEST_PS)) {
+		dev_warn(ctrl->dev, "forcibly allowing all power states due to nvme_core.force_apst -- use at your own risk\n");
+		ctrl->quirks &= ~NVME_QUIRK_NO_DEEPEST_PS;
+	}
+
 	ctrl->oacs = le16_to_cpu(id->oacs);
 	ctrl->vid = le16_to_cpu(id->vid);
 	ctrl->oncs = le16_to_cpup(&id->oncs);
@@ -1526,7 +1535,16 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
 
 	ctrl->npss = id->npss;
 	prev_apsta = ctrl->apsta;
-	ctrl->apsta = (ctrl->quirks & NVME_QUIRK_NO_APST) ? 0 : id->apsta;
+	if (ctrl->quirks & NVME_QUIRK_NO_APST) {
+		if (force_apst && id->apsta) {
+			dev_warn(ctrl->dev, "forcibly allowing APST due to nvme_core.force_apst -- use at your own risk\n");
+			ctrl->apsta = 1;
+		} else {
+			ctrl->apsta = 0;
+		}
+	} else {
+		ctrl->apsta = id->apsta;
+	}
 	memcpy(ctrl->psd, id->psd, sizeof(ctrl->psd));
 
 	if (ctrl->ops->is_fabrics) {
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1628929 — Re: [PATCH 3/3] nvme: Add nvme_core.force_apst to ignore the NO_APST quirk

FromChristoph Hellwig <hch@lst.de>
Date2017-04-23 10:20 +0200
SubjectRe: [PATCH 3/3] nvme: Add nvme_core.force_apst to ignore the NO_APST quirk
Message-ID<tzkUq-5Yo-11@gated-at.bofh.it>
In reply to#1628682
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web