nvme: Add SMART WARNING for persistent memory region

NVME 2.0 added persistent memory regions, and this bit reports critical
warnings / errors with those regions.

Sponsored by:		Netflix
Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D44213
This commit is contained in:
Warner Losh 2024-03-06 18:22:44 -07:00
parent 5cdedf676d
commit 2a2682ee53
2 changed files with 5 additions and 1 deletions

View File

@ -553,8 +553,9 @@ enum nvme_critical_warning_state {
NVME_CRIT_WARN_ST_DEVICE_RELIABILITY = 0x4,
NVME_CRIT_WARN_ST_READ_ONLY = 0x8,
NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP = 0x10,
NVME_CRIT_WARN_ST_PERSISTENT_MEMORY_REGION = 0x20,
};
#define NVME_CRIT_WARN_ST_RESERVED_MASK (0xE0)
#define NVME_CRIT_WARN_ST_RESERVED_MASK (0xC0)
#define NVME_ASYNC_EVENT_NS_ATTRIBUTE (0x100)
#define NVME_ASYNC_EVENT_FW_ACTIVATE (0x200)

View File

@ -663,6 +663,9 @@ nvme_ctrlr_log_critical_warnings(struct nvme_controller *ctrlr,
if (state & NVME_CRIT_WARN_ST_VOLATILE_MEMORY_BACKUP)
nvme_printf(ctrlr, "SMART WARNING: volatile memory backup device failed\n");
if (state & NVME_CRIT_WARN_ST_PERSISTENT_MEMORY_REGION)
nvme_printf(ctrlr, "SMART WARNING: persistent memory read only or unreliable\n");
if (state & NVME_CRIT_WARN_ST_RESERVED_MASK)
nvme_printf(ctrlr, "SMART WARNING: unknown critical warning(s): state = 0x%02x\n",
state & NVME_CRIT_WARN_ST_RESERVED_MASK);