* [PATCH] nvme-cli: Implement printing the get host controlled thermal management feature.
@ 2018-06-13 20:15 Revanth Rajashekar
2018-06-15 9:35 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Revanth Rajashekar @ 2018-06-13 20:15 UTC (permalink / raw)
Signed-off-by: Revanth Rajashekar <revanth.rajashekar at intel.com>
---
linux/nvme.h | 1 +
nvme-print.c | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/linux/nvme.h b/linux/nvme.h
index 01b4e6d..62e18fc 100644
--- a/linux/nvme.h
+++ b/linux/nvme.h
@@ -857,6 +857,7 @@ enum {
NVME_FEAT_HOST_MEM_BUF = 0x0d,
NVME_FEAT_TIMESTAMP = 0x0e,
NVME_FEAT_KATO = 0x0f,
+ NVME_FEAT_HCTM = 0X10,
NVME_FEAT_RRL = 0x12,
NVME_FEAT_PLM_CONFIG = 0x13,
NVME_FEAT_PLM_WINDOW = 0x14,
diff --git a/nvme-print.c b/nvme-print.c
index cdaf1cb..3ff9b83 100644
--- a/nvme-print.c
+++ b/nvme-print.c
@@ -1450,6 +1450,7 @@ char *nvme_feature_to_string(int feature)
case NVME_FEAT_HOST_ID: return "Host Identifier";
case NVME_FEAT_RESV_MASK: return "Reservation Notification Mask";
case NVME_FEAT_RESV_PERSIST: return "Reservation Persistence";
+ case NVME_FEAT_HCTM: return "Host Controlled Thermal Management";
default: return "Unknown";
}
}
@@ -1807,6 +1808,10 @@ void nvme_feature_show_fields(__u32 fid, unsigned int result, unsigned char *buf
case NVME_FEAT_RESV_PERSIST:
printf("\tPersist Through Power Loss (PTPL): %s\n", (result & 0x00000001) ? "True":"False");
break;
+ case NVME_FEAT_HCTM:
+ printf("\tThermal Management Temperature 1 (TMT1) : %u Kelvin\n", (result >> 16));
+ printf("\tThermal Management Temperature 2 (TMT2) : %u Kelvin\n", (result & 0x0000ffff));
+ break;
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] nvme-cli: Implement printing the get host controlled thermal management feature.
2018-06-13 20:15 [PATCH] nvme-cli: Implement printing the get host controlled thermal management feature Revanth Rajashekar
@ 2018-06-15 9:35 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2018-06-15 9:35 UTC (permalink / raw)
> --- a/linux/nvme.h
> +++ b/linux/nvme.h
> @@ -857,6 +857,7 @@ enum {
> NVME_FEAT_HOST_MEM_BUF = 0x0d,
> NVME_FEAT_TIMESTAMP = 0x0e,
> NVME_FEAT_KATO = 0x0f,
> + NVME_FEAT_HCTM = 0X10,
> NVME_FEAT_RRL = 0x12,
> NVME_FEAT_PLM_CONFIG = 0x13,
> NVME_FEAT_PLM_WINDOW = 0x14,
Please also send any uptdates to this file to the kernel.
> case NVME_FEAT_RESV_PERSIST:
> printf("\tPersist Through Power Loss (PTPL): %s\n", (result & 0x00000001) ? "True":"False");
> break;
> + case NVME_FEAT_HCTM:
> + printf("\tThermal Management Temperature 1 (TMT1) : %u Kelvin\n", (result >> 16));
> + printf("\tThermal Management Temperature 2 (TMT2) : %u Kelvin\n", (result & 0x0000ffff));
> + break;
> }
Please use a new line for the argument after the format string.
Also both pairs of inner braces are not required.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-15 9:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13 20:15 [PATCH] nvme-cli: Implement printing the get host controlled thermal management feature Revanth Rajashekar
2018-06-15 9:35 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.