Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1628669 > unrolled thread
| Started by | Andy Lutomirski <luto@kernel.org> |
|---|---|
| First post | 2017-04-22 01:20 +0200 |
| Last post | 2017-04-23 10:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 2/3] nvme: Display raw APST configuration via DYNAMIC_DEBUG Andy Lutomirski <luto@kernel.org> - 2017-04-22 01:20 +0200
Re: [PATCH 2/3] nvme: Display raw APST configuration via DYNAMIC_DEBUG Christoph Hellwig <hch@lst.de> - 2017-04-23 10:20 +0200
| From | Andy Lutomirski <luto@kernel.org> |
|---|---|
| Date | 2017-04-22 01:20 +0200 |
| Subject | [PATCH 2/3] nvme: Display raw APST configuration via DYNAMIC_DEBUG |
| Message-ID | <tyQ0h-3xb-7@gated-at.bofh.it> |
Debugging APST is currently a bit of a pain. This gives optional
simple log messages that describe the APST state.
The easiest way to use this is probably with the nvme_core.dyndbg=+p
module parameter.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
drivers/nvme/host/core.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index b0c692a14e9b..05ba4f8bb73b 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1278,6 +1278,8 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
unsigned apste;
struct nvme_feat_auto_pst *table;
+ u64 max_lat_us = 0;
+ int max_ps = -1;
int ret;
/*
@@ -1299,6 +1301,7 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
if (ctrl->ps_max_latency_us == 0) {
/* Turn off APST. */
apste = 0;
+ dev_dbg(ctrl->device, "APST disabled\n");
} else {
__le64 target = cpu_to_le64(0);
int state;
@@ -1348,9 +1351,22 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl)
target = cpu_to_le64((state << 3) |
(transition_ms << 8));
+
+ if (max_ps == -1)
+ max_ps = state;
+
+ if (total_latency_us > max_lat_us)
+ max_lat_us = total_latency_us;
}
apste = 1;
+
+ if (max_ps == -1) {
+ dev_dbg(ctrl->device, "APST enabled but no non-operational states are available\n");
+ } else {
+ dev_dbg(ctrl->device, "APST enabled: max PS = %d, max round-trip latency = %lluus, table = %*phN\n",
+ max_ps, max_lat_us, (int)sizeof(*table), table);
+ }
}
ret = nvme_set_features(ctrl, NVME_FEAT_AUTO_PST, apste,
--
2.9.3
[toc] | [next] | [standalone]
| From | Christoph Hellwig <hch@lst.de> |
|---|---|
| Date | 2017-04-23 10:20 +0200 |
| Subject | Re: [PATCH 2/3] nvme: Display raw APST configuration via DYNAMIC_DEBUG |
| Message-ID | <tzkUp-5Yo-1@gated-at.bofh.it> |
| In reply to | #1628669 |
Looks good, Reviewed-by: Christoph Hellwig <hch@lst.de>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web