Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] nvme: make SMART / Health Status AENs reach hwmon alarms
@ 2026-11-09 12:02 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:02 ` [PATCH 2/2] nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN Guixin Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Guixin Liu @ 2026-11-09 12:02 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
	Nilay Shroff, Daniel Wagner, Hannes Reinecke
  Cc: linux-nvme

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 or spare-block condition. The device does send a
SMART / Health Status asynchronous event when its health status
changes, but the host never subscribes to it, and the completion path
silently drops the event.

This series wires the event through:

  Patch 1 defines the missing OAES bit in the uapi header.
  Patch 2 subscribes to the event and wakes pollers on temp1_alarm.

The alarm read fetches the SMART log on demand, so the completion path
only queues a work item to call sysfs_notify() — nvme-pci completes
asynchronous events from interrupt context, where sysfs_notify() cannot
sleep.

Testing: verified end to end against QEMU's nvme emulation (with a
one-line local patch reporting OAES bit 1, matching an NVMe 2.0
device): 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.

Guixin Liu (2):
  nvme: define the SMART / Health Status async event bit
  nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN

 drivers/nvme/host/core.c  |  8 ++++++--
 drivers/nvme/host/hwmon.c | 30 ++++++++++++++++++++++++++++++
 drivers/nvme/host/nvme.h  |  5 +++++
 include/linux/nvme.h      |  2 ++
 4 files changed, 43 insertions(+), 2 deletions(-)

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>

-- 
2.43.7



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

end of thread, other threads:[~2026-11-09 12:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox