From: Revanth Rajashekar Date: Wed, 13 Jun 2018 20:15:31 +0000 (-0600) Subject: nvme-cli: Implement printing the get host controlled thermal management feature. X-Git-Tag: v1.6~24 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1ad8283551925aea13c807c149cede5e73140738;p=users%2Fsagi%2Fnvme-cli.git nvme-cli: Implement printing the get host controlled thermal management feature. Signed-off-by: Revanth Rajashekar Signed-off-by: Keith Busch --- diff --git a/linux/nvme.h b/linux/nvme.h index 01b4e6df..62e18fc7 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 242eb4e4..eee716e0 100644 --- a/nvme-print.c +++ b/nvme-print.c @@ -1451,6 +1451,7 @@ char *nvme_feature_to_string(int feature) case NVME_FEAT_RESV_MASK: return "Reservation Notification Mask"; case NVME_FEAT_RESV_PERSIST: return "Reservation Persistence"; case NVME_FEAT_TIMESTAMP: return "Timestamp"; + case NVME_FEAT_HCTM: return "Host Controlled Thermal Management"; default: return "Unknown"; } } @@ -1822,6 +1823,10 @@ void nvme_feature_show_fields(__u32 fid, unsigned int result, unsigned char *buf case NVME_FEAT_TIMESTAMP: show_timestamp((struct nvme_timestamp *)buf); 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; } }