[PATCH v2 1/1] nvme-hwmon: notify hwmon alarms on the SMART / Health Status AEN

Guixin Liu kanie at linux.alibaba.com
Sun Nov 22 18:03:23 PST 2026



在 2026/11/18 22:28, Nilay Shroff 写道:
> Hi Guixin,
>
> On 11/10/26 4:37 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 bit 1 of the SMART / Health Critical
>> Warnings field of the Asynchronous Event Configuration (feature 0x0b,
>> command dword 11 bits 7:0), which mirrors the critical_warning byte of
>> the SMART log. Unlike the notice events, it has no OAES capability bit,
>> so the subscription does not go through ctrl->oaes.
>>
>> The event stays latched until the SMART log is read with RAE cleared,
>> so the deferred work re-reads it before the completion path re-arms
>> the Asynchronous Event Request, and then calls hwmon_notify_event()
>> on temp1_alarm. hwmon_notify_event() also feeds the thermal zone
>> registered with HWMON_C_REGISTER_TZ and emits the standard hwmon
>> uevent, which a plain sysfs_notify() would skip.
>>
>> 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>
>
> I was looking at this patch and found the temperature alarm notification
> particularly useful. I think this functionality could also be integrated
> into nvme-top.
>
> With this change, nvme-top could rely on hwmon uevents to detect NVMe
> temperature alarm changes instead of polling temp1_alarm.
>
> I also noticed that Sashiko raised a few review comments on this patch,
> which appear valid to me. Are you planning to address those comments and
> send an updated version?
Sure, I'm working on v3 patch - there are quite a lot of senarios to take into account.

Best Regards,
Guixin Liu
>
> Thanks,
> --Nilay




More information about the Linux-nvme mailing list