All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/nvme: fix smart aen
@ 2022-05-06  6:36 Klaus Jensen
  2022-05-06  7:31 ` zhenwei pi
  2022-05-12  5:39 ` Klaus Jensen
  0 siblings, 2 replies; 3+ messages in thread
From: Klaus Jensen @ 2022-05-06  6:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Zhenwei Pi, qemu-block, Klaus Jensen, Keith Busch, Klaus Jensen

From: Klaus Jensen <k.jensen@samsung.com>

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().

Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning")
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/nvme/ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 08574c4dcbc8..a2f6069f7fe1 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -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;
-- 
2.36.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/nvme: fix smart aen
  2022-05-06  6:36 [PATCH] hw/nvme: fix smart aen Klaus Jensen
@ 2022-05-06  7:31 ` zhenwei pi
  2022-05-12  5:39 ` Klaus Jensen
  1 sibling, 0 replies; 3+ messages in thread
From: zhenwei pi @ 2022-05-06  7:31 UTC (permalink / raw)
  To: Klaus Jensen, qemu-devel; +Cc: qemu-block, Keith Busch, Klaus Jensen

On 5/6/22 14:36, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> 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().
> 
> Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning")
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
>   hw/nvme/ctrl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 08574c4dcbc8..a2f6069f7fe1 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -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.

Acked-by: zhenwei pi <pizhenwei@bytedance.com>

-- 
zhenwei pi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/nvme: fix smart aen
  2022-05-06  6:36 [PATCH] hw/nvme: fix smart aen Klaus Jensen
  2022-05-06  7:31 ` zhenwei pi
@ 2022-05-12  5:39 ` Klaus Jensen
  1 sibling, 0 replies; 3+ messages in thread
From: Klaus Jensen @ 2022-05-12  5:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: Zhenwei Pi, qemu-block, Keith Busch, Klaus Jensen

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

On May  6 08:36, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> 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().
> 
> Fixes: c62720f137df ("hw/block/nvme: trigger async event during injecting smart warning")
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
>  hw/nvme/ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 08574c4dcbc8..a2f6069f7fe1 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -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;
> -- 
> 2.36.0
> 

Applied to nvme-next.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-12  5:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  6:36 [PATCH] hw/nvme: fix smart aen Klaus Jensen
2022-05-06  7:31 ` zhenwei pi
2022-05-12  5:39 ` Klaus Jensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.