From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C72E94A5C5C for ; Wed, 2 Sep 2026 20:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788379583; cv=none; b=doj35/PNX1nQh/bz3LftBshJw2Qdm0rRhvGNNs/ZynXwoH+TEbu+/YGnMPzulx5GVb0ha//BT2I48NZtNFr03UKnknzqIGauOsfo214FHbyfV+l1WIBXdhjjoI2TpZbQbAXZ7mXbv4Vu+SKba9H9gtJI2g1VX5hcYP4D4onbCZ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788379583; c=relaxed/simple; bh=Eech0gy65GAyXynFCo9H4txIPW1uvlMnLzdl3n7agz8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Deidpl/tqcCwtzgAzeo5ZBNtWSBIK947pqmEZHwJBf9T1Z7bCMV/tOvpKZbuycJ0B5w8xOTo4zsHp9lkjXnhens1Gnrj/jcI6dTZYoIJVXW1pzZmTj6iwzLRA+dx4Bi9DRD7S/Qkmw2Y0HBnjozQOhx4e7eUJ9HLl4TYu/V/NqE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=N6Cs2fV1; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="N6Cs2fV1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788379580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UMvbLiMb+sF2mtOC2uLwr9SRzXheSA2PXAvP/FINdPY=; b=N6Cs2fV1fm8MwRqUkXPsx1vC9EvZkUA8pTnsCeYPYP80TaNBknMGml+uVr1vN7LmSbW90i VZiN/nPIb+nV7xgz9McBYjltoTK2ef75etkD8nPRiZo4jwsNOqpFI8VfuHjSnNjgnHAkrf /csKut2g6TilKq+qpQWXovvnQarWeoI= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-l6utWQtSM8iZ4kPy_-lR3g-1; Wed, 02 Sep 2026 16:06:15 -0400 X-MC-Unique: l6utWQtSM8iZ4kPy_-lR3g-1 X-Mimecast-MFC-AGG-ID: l6utWQtSM8iZ4kPy_-lR3g_1788379571 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7B45F195DE47; Wed, 2 Sep 2026 20:06:11 +0000 (UTC) Received: from jtaubepe-thinkpadx1carbongen12.ibmlowe.csb (unknown [10.17.16.153]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 247C61955F04; Wed, 2 Sep 2026 20:06:08 +0000 (UTC) From: Jesse Taube To: linux-nvme@lists.infradead.org Cc: linux-scsi@vger.kernel.org, Jonathan Corbet , Shuah Khan , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Justin Tee , Naresh Gottumukkala , Paul Ely , Chaitanya Kulkarni , "James E.J. Bottomley" , "Martin K. Petersen" , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, Hannes Reinecke , Jesse Taube , "Gustavo A. R. Silva" , John Meneghini , Bryan Gurney , Chris Leech , "Ewan D . Milne" , shinichiro.kawasaki@wdc.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Muneendra Kumar Subject: [PATCH v2 5/7] nvme: sysfs: emit the marginal path state in show_state() Date: Wed, 2 Sep 2026 16:05:45 -0400 Message-ID: <20260902200547.184734-6-jtaubepe@redhat.com> In-Reply-To: <20260902200547.184734-1-jtaubepe@redhat.com> References: <20260902200547.184734-1-jtaubepe@redhat.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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