From: Guixin Liu <kanie@linux.alibaba.com>
To: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Nilay Shroff <nilay@linux.ibm.com>,
Daniel Wagner <dwagner@suse.de>, Hannes Reinecke <hare@suse.de>
Cc: linux-nvme@lists.infradead.org
Subject: [PATCH v4 0/3] nvme: make SMART / Health Status AENs reach hwmon alarms
Date: Tue, 24 Nov 2026 20:00:29 +0800 [thread overview]
Message-ID: <20261124120032.1824788-1-kanie@linux.alibaba.com> (raw)
The NVMe hwmon support exposes the temperature alarm as a plain sysfs
attribute, so monitoring tools have to poll temp1_alarm to learn about
a critical temperature condition. The device does send a SMART / Health
Status asynchronous event when a critical warning is raised, but the
host never enables it in the Asynchronous Event Configuration, and the
completion path silently drops the event.
The temperature warning is subscribed unconditionally when hwmon is
present (it has no OAES capability bit), a work item embedded in
nvme_ctrl re-reads the SMART log to clear the latched event -- the
same shape as the namespace scan reading the changed namespace list --
and the alarm is announced with hwmon_notify_event(), which also feeds
the registered thermal zone.
Testing: verified end to end against QEMU's nvme emulation: injecting
smart_critical_warning over QMP delivers the AEN, poll(2) on
temp1_alarm wakes immediately with EPOLLERR|EPOLLPRI and reads alarm=1;
clearing the warning produces no event and no spurious wake;
re-injecting the bit wakes again; enabling the spare-block warning
through an admin passthrough delivers the AEN without waking the
temperature alarm; a controller modeled to reject the critical warning
subscription with Invalid Field in Command falls back to the
notice-only mask, which a Get Features of the Asynchronous Event
Configuration confirms; a temperature event whose warning recovers
before the deferred log is read still wakes the poll with alarm=0.
Changes since v3:
- split the preparation into its own patches: an event bit enum for
nvme_ctrl::events, whose only bit was indexed with an AER subtype
value so far, and the SMART / Health Status asynchronous event
subtype values
- notify temp1_alarm when the event information indicates the
temperature threshold, not only when the re-read log still has the
temperature critical warning set, so that a transient excursion
that recovered before the log is read is still reported (Nilay
Shroff)
Link: https://lore.kernel.org/all/20261123112342.2761131-1-kanie@linux.alibaba.com/
Guixin Liu (3):
nvme: define an event bit enum for nvme_ctrl::events
nvme: define the SMART / Health Status async event subtypes
nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN
drivers/nvme/host/core.c | 32 +++++++++++++++++++++++++++----
drivers/nvme/host/hwmon.c | 37 +++++++++++++++++++++++++++++++++++++
drivers/nvme/host/nvme.h | 25 +++++++++++++++++++++++++
include/linux/nvme.h | 6 ++++++
4 files changed, 96 insertions(+), 4 deletions(-)
--
2.43.7
next reply other threads:[~2026-11-24 12:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 12:00 Guixin Liu [this message]
2026-11-24 12:00 ` [PATCH v4 1/3] nvme: define an event bit enum for nvme_ctrl::events Guixin Liu
2026-11-24 15:24 ` Nilay Shroff
2026-11-25 5:17 ` Christoph Hellwig
2026-11-25 5:45 ` Guixin Liu
2026-11-24 12:00 ` [PATCH v4 2/3] nvme: define the SMART / Health Status async event subtypes Guixin Liu
2026-11-24 15:24 ` Nilay Shroff
2026-11-25 5:18 ` Christoph Hellwig
2026-11-25 5:46 ` Guixin Liu
2026-11-24 12:00 ` [PATCH v4 3/3] nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN Guixin Liu
2026-11-24 15:25 ` Nilay Shroff
2026-11-25 5:18 ` Christoph Hellwig
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=20261124120032.1824788-1-kanie@linux.alibaba.com \
--to=kanie@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=dwagner@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nilay@linux.ibm.com \
--cc=sagi@grimberg.me \
/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