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.133.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 7DA872FD7B1 for ; Wed, 13 Aug 2025 20:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755115736; cv=none; b=nVlL4YLTYXGd3WSkE3fgxLh5819AqRz48v74IB55IUBxiSdmFJhrO9TVbcD5CQoEye8xKnlO3L5vpfGB+JsTlyhLPO0FMgYAAJJPJlH+TOKLu1DWPiBzytOVU43R8DvhCd4E4EtA08VA1ssDlksSIw1/4zpC0sdWLMAxuLWtstY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755115736; c=relaxed/simple; bh=NnZ3TC8BpF84mmicXpfwwZ9dkNEK7cC+fz0XoOrNlLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CjXAgPzdtqKDvVmvqW+slE63/RTUkvhpOupSjJOGNnpusBgXAon9ggsYwhdHqnzO8vUN5GMIgOr2WkmEVH7TGT2wmW4/dC1ih+HTsWgw9WT72RsGgPSWeNBy9gam+VQZgpofIlqXt+MVYfNoukC46YyL1xwfDfMxk1U7hVJq5r8= 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=ZwN48iFF; arc=none smtp.client-ip=170.10.133.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="ZwN48iFF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1755115733; 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=NANpq5j0QRDeFcPPjmiwwML+SQhgqErHhixAlpANfGI=; b=ZwN48iFFtI451xD+rI+4MSlnA/nkI4elk/B15aBh7/KwCARaaLeMHPXNeljceBtkrgTHiU KZ2wGEvdJefAqynmR6w5zbz4otrtTR0yAHn2hz8tctz7wX3ZOpl5KGtHZomDbcM3l0KVw8 t+inx9C4JDBtTpDHj7gt1dgfQfgxkbs= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-8slgemYANWa90JYFwSvOBg-1; Wed, 13 Aug 2025 16:08:50 -0400 X-MC-Unique: 8slgemYANWa90JYFwSvOBg-1 X-Mimecast-MFC-AGG-ID: 8slgemYANWa90JYFwSvOBg_1755115728 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6AEF31800248; Wed, 13 Aug 2025 20:08:48 +0000 (UTC) Received: from bgurney-thinkpadp1gen5.remote.csb (unknown [10.44.32.39]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 736B618003FC; Wed, 13 Aug 2025 20:08:42 +0000 (UTC) From: Bryan Gurney To: linux-nvme@lists.infradead.org, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, axboe@kernel.dk Cc: james.smart@broadcom.com, njavali@marvell.com, linux-scsi@vger.kernel.org, hare@suse.de, linux-hardening@vger.kernel.org, kees@kernel.org, gustavoars@kernel.org, bgurney@redhat.com, jmeneghi@redhat.com, emilne@redhat.com Subject: [PATCH v9 7/9] nvme: sysfs: emit the marginal path state in show_state() Date: Wed, 13 Aug 2025 16:07:42 -0400 Message-ID: <20250813200744.17975-8-bgurney@redhat.com> In-Reply-To: <20250813200744.17975-1-bgurney@redhat.com> References: <20250813200744.17975-1-bgurney@redhat.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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 --- drivers/nvme/host/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c index 29430949ce2f..4a6135c2f9cb 100644 --- a/drivers/nvme/host/sysfs.c +++ b/drivers/nvme/host/sysfs.c @@ -430,7 +430,9 @@ static ssize_t nvme_sysfs_show_state(struct device *dev, }; if (state < ARRAY_SIZE(state_name) && state_name[state]) - return sysfs_emit(buf, "%s\n", state_name[state]); + return sysfs_emit(buf, "%s\n", + (nvme_ctrl_is_marginal(ctrl)) ? "marginal" : + state_name[state]); return sysfs_emit(buf, "unknown state\n"); } -- 2.50.1