[PATCH v4 3/3] nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN
Nilay Shroff
nilay at linux.ibm.com
Tue Nov 24 07:25:33 PST 2026
On 11/24/26 5:30 PM, Guixin Liu wrote:
> 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 configured through the SMART / Health
> Critical Warnings field of the Asynchronous Event Configuration, which
> mirrors the critical_warning byte of the SMART log and has no OAES
> capability bit, so the subscription does not go through ctrl->oaes.
> A rejection with Invalid Field in Command falls back to the
> notice-only mask, so the notice events are not lost with it.
>
> On the event, a work item embedded in nvme_ctrl re-reads the SMART log
> to clear the latched event and notifies temp1_alarm through
> hwmon_notify_event(), which also feeds the registered thermal zone.
> The notification fires when the event information indicates the
> temperature threshold, or when the re-read log has the temperature
> critical warning set, so that a transient excursion that recovered
> before the log is read is still reported.
> The work is only queued while the controller is live and is drained
> before its data is freed. The nvme-pci transport completes
> asynchronous events from interrupt context, so the completion path
> only queues the work.
>
> Signed-off-by: Guixin Liu<kanie at linux.alibaba.com>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay at linux.ibm.com>
More information about the Linux-nvme
mailing list