From c09d038d3833db293e4fa77c0e49af8b7e6bc562 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 24 Jun 2020 08:28:50 -0700 Subject: [PATCH] Added DITT explanation and cleaned up spacing --- Documentation/nvme-wdc-vs-temperature-stats.1 | 8 ++-- .../nvme-wdc-vs-temperature-stats.html | 6 +-- .../nvme-wdc-vs-temperature-stats.txt | 4 +- plugins/wdc/wdc-nvme.c | 44 +++++++++---------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Documentation/nvme-wdc-vs-temperature-stats.1 b/Documentation/nvme-wdc-vs-temperature-stats.1 index 9d540295..3fafdb21 100644 --- a/Documentation/nvme-wdc-vs-temperature-stats.1 +++ b/Documentation/nvme-wdc-vs-temperature-stats.1 @@ -2,12 +2,12 @@ .\" Title: nvme-wdc-vs-temperature-stats .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 06/23/2020 +.\" Date: 06/24/2020 .\" Manual: NVMe Manual .\" Source: NVMe .\" Language: English .\" -.TH "NVME\-WDC\-VS\-TEMPE" "1" "06/23/2020" "NVMe" "NVMe Manual" +.TH "NVME\-WDC\-VS\-TEMPE" "1" "06/24/2020" "NVMe" "NVMe Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -87,10 +87,10 @@ temp of critical overheating T} T{ .sp -DITT support status +Device Initiated Thermal Throttling support status T}:T{ .sp -0 = unsupported +0 = unsupported, 1 = supported T} T{ .sp diff --git a/Documentation/nvme-wdc-vs-temperature-stats.html b/Documentation/nvme-wdc-vs-temperature-stats.html index 745ac737..32801315 100644 --- a/Documentation/nvme-wdc-vs-temperature-stats.html +++ b/Documentation/nvme-wdc-vs-temperature-stats.html @@ -789,8 +789,8 @@ cellspacing="0" cellpadding="4">

temp of critical overheating

-

DITT support status

-

0 = unsupported

+

Device Initiated Thermal Throttling support status

+

0 = unsupported, 1 = supported

Host Controlled Thermal Management support

@@ -857,7 +857,7 @@ Displays the temperature stats for the device: diff --git a/Documentation/nvme-wdc-vs-temperature-stats.txt b/Documentation/nvme-wdc-vs-temperature-stats.txt index 03a918ba..1d000e30 100644 --- a/Documentation/nvme-wdc-vs-temperature-stats.txt +++ b/Documentation/nvme-wdc-vs-temperature-stats.txt @@ -35,8 +35,8 @@ Expected status and description :- |Critical Composite TEMPerature threshold |temp of critical overheating -|DITT support status -|0 = unsupported +|Device Initiated Thermal Throttling support status +|0 = unsupported, 1 = supported |Host Controlled Thermal Management support |0 = unsupported, 1 = supported diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index 63454630..7dbece9a 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -19,7 +19,7 @@ * Author: Chaitanya Kulkarni , * Dong Ho , * Jeff Lien - * Brandon Paupore + * Brandon Paupore */ #include #include @@ -6554,9 +6554,9 @@ static int wdc_vs_temperature_stats(int argc, char **argv, { const char *desc = "Send a vs-temperature-stats command."; struct nvme_smart_log smart_log; - struct nvme_id_ctrl id_ctrl; + struct nvme_id_ctrl id_ctrl; uint64_t capabilities = 0; - __u32 hctm_tmt; + __u32 hctm_tmt; int fd, ret; OPT_ARGS(opts) = { @@ -6575,40 +6575,40 @@ static int wdc_vs_temperature_stats(int argc, char **argv, return -1; } - /* get the temperature stats or report errors */ + /* get the temperature stats or report errors */ ret = nvme_identify_ctrl(fd, &id_ctrl); - if (ret != 0) + if (ret != 0) goto END; ret = nvme_smart_log(fd, NVME_NSID_ALL, &smart_log); - if (ret != 0) - goto END; + if (ret != 0) + goto END; - /* print the temperature stats */ - printf("Temperature Stats for NVME device:%s namespace-id:%x\n", - devicename, WDC_DE_GLOBAL_NSID); + /* print the temperature stats */ + printf("Temperature Stats for NVME device:%s namespace-id:%x\n", + devicename, WDC_DE_GLOBAL_NSID); - /* convert from Kelvin to degrees Celsius */ + /* convert from Kelvin to degrees Celsius */ int temperature = ((smart_log.temperature[1] << 8) | smart_log.temperature[0]) - 273; printf("Current Composite Temperature : %d °C\n", temperature); - printf("WCTEMP : %"PRIu16" °C\n", id_ctrl.wctemp - 273); + printf("WCTEMP : %"PRIu16" °C\n", id_ctrl.wctemp - 273); printf("CCTEMP : %"PRIu16" °C\n", id_ctrl.cctemp - 273); - printf("DITT support : 0\n"); - printf("HCTM support : %"PRIu16"\n", id_ctrl.hctma); + printf("DITT support : 0\n"); + printf("HCTM support : %"PRIu16"\n", id_ctrl.hctma); /* retrieve HCTM Thermal Management Temperatures */ - nvme_get_feature(fd, 0, 0x10, 0, 0, 0, 0, &hctm_tmt); - temperature = ((hctm_tmt >> 16) & 0xffff) ? ((hctm_tmt >> 16) & 0xffff) - 273 : 0; + nvme_get_feature(fd, 0, 0x10, 0, 0, 0, 0, &hctm_tmt); + temperature = ((hctm_tmt >> 16) & 0xffff) ? ((hctm_tmt >> 16) & 0xffff) - 273 : 0; printf("HCTM Light (TMT1) : %"PRIu16" °C\n", temperature); - printf("TMT1 Transition Counter : %"PRIu32"\n", smart_log.thm_temp1_trans_count); + printf("TMT1 Transition Counter : %"PRIu32"\n", smart_log.thm_temp1_trans_count); printf("TMT1 Total Time : %"PRIu32"\n", smart_log.thm_temp1_total_time); - temperature = (hctm_tmt & 0xffff) ? (hctm_tmt & 0xffff) - 273 : 0; + temperature = (hctm_tmt & 0xffff) ? (hctm_tmt & 0xffff) - 273 : 0; printf("HCTM Heavy (TMT2) : %"PRIu16" °C\n", temperature); - printf("TMT2 Transition Counter : %"PRIu32"\n", smart_log.thm_temp2_trans_count); - printf("TMT2 Total Time : %"PRIu32"\n", smart_log.thm_temp2_total_time); - printf("Thermal Shutdown Threshold : 95 °C\n"); + printf("TMT2 Transition Counter : %"PRIu32"\n", smart_log.thm_temp2_trans_count); + printf("TMT2 Total Time : %"PRIu32"\n", smart_log.thm_temp2_total_time); + printf("Thermal Shutdown Threshold : 95 °C\n"); - END: + END: fprintf(stderr, "NVMe Status:%s(%x)\n", nvme_status_to_string(ret), ret); return ret; } -- 2.50.1