From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 11E9F2C21F3 for ; Wed, 21 Jan 2026 02:57:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768964224; cv=none; b=T1T6c0Fd4WEgNc0epPMJLr0lfSgOK+LWv40+cgvhSxYodyqA0qP9VfBaFeD0uluVr1Sayt70z2uOn79bj7znT3tVYe0uW+VIlHMZR+oNooX9uZRtuM+czgtaPB6jWjdGFZAVBAn2XcoeQ2S2NAVJ49oxrvxjy0OjMht8H7e62U0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768964224; c=relaxed/simple; bh=Cm/jT4hbV0t/Fhh/SDw1JWBIyZMbEb33YQfSFCllwN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=O16gcIy3R7iuKPHFs+TK+ojtNXxt+BIY0jhdkr0k95BZRSEvcqE6JALnwn/n3OVADIK0d+zHAtTIOYowkNPvyYa05wa3v1ILt7qX1fSjEZ3dFiJC9auxK1Na41MQ2q2dGcmrFddMDyvenG2UBFDzEzpWSzxBUITv5g5kBNnJgIw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b6yRu97t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b6yRu97t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F07F5C16AAE; Wed, 21 Jan 2026 02:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768964223; bh=Cm/jT4hbV0t/Fhh/SDw1JWBIyZMbEb33YQfSFCllwN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b6yRu97tahcqdLUXFCInXpRgV5KvWxMK6mx0pGOMwjyU59s+6I/AnRuyNpyMK7l55 /lbaoG3SYqjS4hOE8KXtNoYAHNsIU3RoY/qbqLT1W40p+nsaswENdRI7ExTAJ8UuCs 0eEBkQKAtcJbSH0dGT+KFQnc2zeuOqqlgqygu+OpSN9XdWuQsbP9TTxTAeLAHK9Iig +u98H8J+p6RxF8KeUsKp8AygdY4iGuQSG8slHzSqEOX9V0EVDCgFtWjuou/lhuHTew YwZzp/IXN/hDJRTIVAL5PPqIZ0h87iaR7BLdNrtLkVjpqXQEzqbXuxbBRojH7y2D3M 1UmKDGHYVwM1w== From: Sasha Levin To: stable@vger.kernel.org Cc: Nilay Shroff , Daniel Wagner , Keith Busch , Sasha Levin Subject: [PATCH 6.1.y 3/3] nvme: fix PCIe subsystem reset controller state transition Date: Tue, 20 Jan 2026 21:56:59 -0500 Message-ID: <20260121025659.1157002-3-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260121025659.1157002-1-sashal@kernel.org> References: <2026012012-catalyst-renewable-6c83@gregkh> <20260121025659.1157002-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Nilay Shroff [ Upstream commit 0edb475ac0a7d153318a24d4dca175a270a5cc4f ] The commit d2fe192348f9 (“nvme: only allow entering LIVE from CONNECTING state”) disallows controller state transitions directly from RESETTING to LIVE. However, the NVMe PCIe subsystem reset path relies on this transition to recover the controller on PowerPC (PPC) systems. On PPC systems, issuing a subsystem reset causes a temporary loss of communication with the NVMe adapter. A subsequent PCIe MMIO read then triggers EEH recovery, which restores the PCIe link and brings the controller back online. For EEH recovery to proceed correctly, the controller must transition back to the LIVE state. Due to the changes introduced by commit d2fe192348f9 (“nvme: only allow entering LIVE from CONNECTING state”), the controller can no longer transition directly from RESETTING to LIVE. As a result, EEH recovery exits prematurely, leaving the controller stuck in the RESETTING state. Fix this by explicitly transitioning the controller state from RESETTING to CONNECTING and then to LIVE. This satisfies the updated state transition rules and allows the controller to be successfully recovered on PPC systems following a PCIe subsystem reset. Cc: stable@vger.kernel.org Fixes: d2fe192348f9 ("nvme: only allow entering LIVE from CONNECTING state") Reviewed-by: Daniel Wagner Signed-off-by: Nilay Shroff Signed-off-by: Keith Busch Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index eeb170831dddb..519506943858d 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1213,7 +1213,10 @@ static int nvme_pci_subsystem_reset(struct nvme_ctrl *ctrl) } writel(NVME_SUBSYS_RESET, dev->bar + NVME_REG_NSSR); - nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE); + + if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) || + !nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE)) + goto unlock; /* * Read controller status to flush the previous write and trigger a -- 2.51.0