[PATCH v2 5/7] nvme: sysfs: emit the marginal path state in show_state()

Jesse Taube jtaubepe at redhat.com
Wed Sep 2 13:05:45 PDT 2026


From: Bryan Gurney <bgurney at redhat.com>

If a controller has received a link integrity or congestion event, and
has the NVME_CTRL_MARGINAL flag set, emit "marginal" in the state
instead of "live", to identify the marginal paths.

Co-developed-by: John Meneghini <jmeneghi at redhat.com>
Signed-off-by: John Meneghini <jmeneghi at redhat.com>
Reviewed-by: Hannes Reinecke <hare at suse.de>
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
Tested-by: Muneendra Kumar <muneendra.kumar at broadcom.com>
Signed-off-by: Bryan Gurney <bgurney at redhat.com>
---
V10 -> V1:
 - No change
V1 -> V2:
 - Only emit "marginal" if port is "live"
---
 drivers/nvme/host/sysfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 75b2d69b5957..9ede6b37f27a 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -526,6 +526,9 @@ static ssize_t nvme_sysfs_show_state(struct device *dev,
 		[NVME_CTRL_DEAD]	= "dead",
 	};
 
+	if (state == NVME_CTRL_LIVE && nvme_ctrl_is_marginal(ctrl))
+		return sysfs_emit(buf, "%s\n", "marginal");
+
 	if (state < ARRAY_SIZE(state_name) && state_name[state])
 		return sysfs_emit(buf, "%s\n", state_name[state]);
 
-- 
2.55.0




More information about the Linux-nvme mailing list