nvme-cli: Implement printing the get host controlled thermal management feature.
PATCH 1/1 nvme-cli: Implement printing the get host controlled thermal management feature.
Signed-off-by Revanth Rajashekar <revanth.rajashekar at intel.com>
--- linux/nvme.h | 1 + nvme-print.c | 5 +++++ 2 files changed, 6 insertions(+)
linux/nvme.h +1 -0
@@ -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,
nvme-print.c +5 -0
@@ -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 *bufcase 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 ; } }
Signature · 1 line
2.17.1
PATCH 1/1 nvme-cli: Implement printing the get host controlled thermal management feature.
linux/nvme.h enum { · line 863
Quoted 10 lines
linux/nvme.h +1
-0@@ -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.
linux/nvme.h
Quoted 8 lines
linux/nvme.h +4
-0case 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.