[PATCH 3/3] nvme: enable smart AEN
From: zhenwei pi
Date: Sat May 07 2022 - 02:54:41 EST
Try to enable AEN on host side, this is helpful to minitor the
critical warning from the NVMe controller.
Signed-off-by: zhenwei pi <pizhenwei@xxxxxxxxxxxxx>
---
drivers/nvme/host/core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index e1846d04817f..f386a4f1d434 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1490,8 +1490,12 @@ int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count)
}
EXPORT_SYMBOL_GPL(nvme_set_queue_count);
+#define NVME_AEN_SMART \
+ (NVME_AEN_CFG_SMART_CRIT_SPARE | NVME_AEN_CFG_SMART_CRIT_TEMPERATURE | \
+ NVME_AEN_CFG_SMART_CRIT_RELIABILITY | NVME_AEN_CFG_SMART_CRIT_MEDIA | \
+ NVME_AEN_CFG_SMART_CRIT_VOLATILE_MEMORY | NVME_AEN_CFG_SMART_CRIT_PMR_UNRELIABLE)
#define NVME_AEN_SUPPORTED \
- (NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | \
+ (NVME_AEN_SMART | NVME_AEN_CFG_NS_ATTR | NVME_AEN_CFG_FW_ACT | \
NVME_AEN_CFG_ANA_CHANGE | NVME_AEN_CFG_DISC_CHANGE)
static void nvme_enable_aen(struct nvme_ctrl *ctrl)
--
2.20.1