From: Bryan Gurney 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 Signed-off-by: John Meneghini Reviewed-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Tested-by: Muneendra Kumar Signed-off-by: Bryan Gurney --- 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