Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Guixin Liu" <kanie@linux.alibaba.com>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH 1/2] nvme: define the SMART / Health Status async event bit
Date: Mon, 09 Nov 2026 12:09:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-204916@kernel.org> (raw)
In-Reply-To: <20261109120207.1352165-2-kanie@linux.alibaba.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] nvme: NVME_AEN_BIT_SMART and NVME_AEN_CFG_SMART use wrong
  OAES/CFG bit
--

commit be7079eb32755ede896d21f96ed7d1785a179279
Author: Guixin Liu <kanie@linux.alibaba.com>

nvme: define the SMART / Health Status async event bit

This commit adds NVME_AEN_BIT_SMART and NVME_AEN_CFG_SMART definitions to
include/linux/nvme.h.

> diff --git a/include/linux/nvme.h b/include/linux/nvme.h
> index 6248711784b37..2b4f8e269d12d 100644
> --- a/include/linux/nvme.h
> +++ b/include/linux/nvme.h
> @@ -867,6 +867,7 @@ enum {
>  };
>  
>  enum {
> +	NVME_AEN_BIT_SMART		= 1,
>  	NVME_AEN_BIT_NS_ATTR		= 8,
>  	NVME_AEN_BIT_FW_ACT		= 9,
>  	NVME_AEN_BIT_ANA_CHANGE		= 11,
> @@ -874,6 +875,7 @@ enum {
>  };
>  
>  enum {
> +	NVME_AEN_CFG_SMART		= 1 << NVME_AEN_BIT_SMART,
>  	NVME_AEN_CFG_NS_ATTR		= 1 << NVME_AEN_BIT_NS_ATTR,
>  	NVME_AEN_CFG_FW_ACT		= 1 << NVME_AEN_BIT_FW_ACT,
>  	NVME_AEN_CFG_ANA_CHANGE		= 1 << NVME_AEN_BIT_ANA_CHANGE,

[Severity: Medium]
Do NVME_AEN_BIT_SMART and NVME_AEN_CFG_SMART match the NVMe specification
for Identify Controller OAES and NVME_FEAT_ASYNC_EVENT?

The value 1 is the Asynchronous Event Type (NVME_AER_SMART = 1) reported
in CQE DW0 bits 2:0, not an OAES or Asynchronous Event Configuration bit.
In the NVMe Base Specification, SMART / Health Critical Warning events are
mandatory, so bits 7:0 of OAES are reserved and zero on compliant
controllers. Checking ctrl->oaes & NVME_AEN_CFG_SMART will therefore find
the bit cleared and never subscribe to the event.

In the NVME_FEAT_ASYNC_EVENT feature (CDW11), bits 7:0 are individual
Critical Warning bitmasks corresponding to byte 0 of struct nvme_smart_log,
already defined right above in include/linux/nvme.h as
NVME_SMART_CRIT_SPARE through NVME_SMART_CRIT_VOLATILE_MEMORY (and used by
NVMET_AEN_CFG_ALL in drivers/nvme/target/nvmet.h). Passing 1 << 1 to Set
Features only enables NVME_SMART_CRIT_TEMPERATURE and leaves spare,
reliability, media, and volatile memory warnings disabled.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109120207.1352165-1-kanie@linux.alibaba.com?part=1


  reply	other threads:[~2026-11-09 12:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 12:02 [PATCH 0/2] nvme: make SMART / Health Status AENs reach hwmon alarms Guixin Liu
2026-11-09 12:02 ` [PATCH 1/2] nvme: define the SMART / Health Status async event bit Guixin Liu
2026-11-09 12:09   ` sashiko-bot [this message]
2026-11-09 12:35     ` Guixin Liu
2026-11-09 12:02 ` [PATCH 2/2] nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN Guixin Liu
2026-11-09 12:19   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-204916@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kanie@linux.alibaba.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox