hw/nvme: fix smart aen
PATCH 1/1 hw/nvme: fix smart aen
From: Klaus Jensen <[email protected]>
Pass the right constant to nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be in nvme_smart_event().
--- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/nvme/ctrl.c +1 -1
@@ -5325,7 +5325,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req)if ((n->temperature >= n->features.temp_thresh_hi) || (n->temperature <= n->features.temp_thresh_low)) { -nvme_smart_event (n,NVME_AER_INFO_SMART_TEMP_THRESH ); +nvme_smart_event (n,NVME_SMART_TEMPERATURE ); }break ;
Signature · 1 line
2.36.0
Quoted 17 lines · Klaus Jensen
From: Klaus Jensen <[email protected]>
Pass the right constant to
nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be innvme_smart_event().Fixes c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning")Signed-off-by Klaus Jensen <[email protected]>--- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/nvme/ctrl.c +0
-0
hw/nvme/ctrl.c static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req) · line 5331
Quoted 8 lines
hw/nvme/ctrl.c +1
-1@@ -5325,7 +5325,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req)if ((n->temperature >= n->features.temp_thresh_hi) || (n->temperature <= n->features.temp_thresh_low)) { -nvme_smart_event (n,NVME_AER_INFO_SMART_TEMP_THRESH ); +nvme_smart_event (n,NVME_SMART_TEMPERATURE ); }break ;
It looks good to me.
Signature · 1 line
zhenwei pi
Klaus Jensen
AppliedQuoted 28 lines · Klaus Jensen
From: Klaus Jensen <[email protected]>
Pass the right constant to
nvme_smart_event(). The NVME_AER* values hold the bit position in the SMART byte, not the shifted value that we expect it to be innvme_smart_event().Fixes c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning")Signed-off-by Klaus Jensen <[email protected]>--- hw/nvme/ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/nvme/ctrl.c +1
-1@@ -5325,7 +5325,7 @@ static uint16_t nvme_set_feature(NvmeCtrl *n, NvmeRequest *req)if ((n->temperature >= n->features.temp_thresh_hi) || (n->temperature <= n->features.temp_thresh_low)) { -nvme_smart_event (n,NVME_AER_INFO_SMART_TEMP_THRESH ); +nvme_smart_event (n,NVME_SMART_TEMPERATURE ); }break ;Signature · 1 line
2.36.0
Applied to nvme-next.