]> www.infradead.org Git - users/hch/nvme-cli.git/commitdiff
Corrected the output of TMT1 and 2
authorBrandon Paupore <brandon.paupore@wdc.com>
Tue, 23 Jun 2020 14:23:14 +0000 (07:23 -0700)
committerKeith Busch <kbusch@kernel.org>
Tue, 30 Jun 2020 17:31:53 +0000 (11:31 -0600)
plugins/wdc/wdc-nvme.c

index 24323f3801a45bc30d8b134a948fef4a6f8e1a36..0329488449c410fb1801fcc245da0c5e51cb7119 100644 (file)
@@ -6585,16 +6585,18 @@ static int wdc_vs_temperature_stats(int argc, char **argv,
         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); 
-       printf("HCTM Light (TMT1)                       : %"PRIu16"\n",
-                (hctm_tmt >> 16) & 0xff);
+       /* 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;     
+       printf("HCTM Light (TMT1)                       : %"PRIu16" °C\n",
+                temperature);
         printf("TMT1 Transition Counter                 : %"PRIu32"\n",
                 smart_log.thm_temp1_trans_count);
        printf("TMT1 Total Time                         : %"PRIu32"\n",
                 smart_log.thm_temp1_total_time);
-        printf("HCTM Heavy (TMT2)                       : %"PRIu16"\n",
-                hctm_tmt & 0xff);
+        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",