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 A1EE93446BE for ; Wed, 21 Jan 2026 02:52:33 +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=1768963953; cv=none; b=byHCdL14W5XpNWB/65YAkp7SSO0IJLn5oo28EDFEihaBNY20YlSb+o0EzHSz1FCix7xmmDQYu3ku2zPeVuVj07ohrJyEkZAj9eMHHFC4o5lzpceoqZVWqD2YR83+dQePcjjcxcGVyjmYZaxCQLgxNi/e6gW79v2UyBtpOE89Qe4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768963953; c=relaxed/simple; bh=FGCV2STuLwHfXW+1F5rNRRuToYctBdcUORKc1KJUk0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bZmbzlnJac83NA6tZZTtOTFVBVQ3C7ow6laoNNaFDP6TV940c80+Ehe0NSvK+rFCmQzgymRjPGkndPKRlkfRN1ZSXQc0xvgKiX3XkQYApYCGHsfnnmz6dSbFxsoximEwAfSF1VoIhdvSYhRlzskbK/e3ewMK8TyO9pXP+YDb1h4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sfSRw9dx; 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="sfSRw9dx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B0DEC19424; Wed, 21 Jan 2026 02:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768963952; bh=FGCV2STuLwHfXW+1F5rNRRuToYctBdcUORKc1KJUk0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sfSRw9dx/OPuAB2aVXUePpNZ3utaUFw+ekB6rZiz4Hpzw6FOSFGxtgnbIX4dmHEbH UT8hCrdkmUB7Lu1mqhr446IHTWp/73vrC9KS8ps7qt0Nohit9OusQvgmPWHN1RWaaA Rx1/C1yXfBdg96na8uIZdsH/B5ZojU1K8Q8JUQvnUDkIrZ/BpNLvFm37tk45BdZOn6 TqmKMnBZUpRqg3BPrJOoT0VvoCL5hcBRMU9Egss82kZoyxHrUlBCcc5PQo212/pe8x DBLXWYpGGchT+T/OwvG1BQKoq8KlpokOLww//YLbPfHK9ICylyVLNbM6Pwi43/Y5zf qwzY/FEY+s0xA== From: Sasha Levin To: stable@vger.kernel.org Cc: Nilay Shroff , Daniel Wagner , Keith Busch , Sasha Levin Subject: [PATCH 6.6.y 3/3] nvme: fix PCIe subsystem reset controller state transition Date: Tue, 20 Jan 2026 21:52:28 -0500 Message-ID: <20260121025228.1153601-3-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260121025228.1153601-1-sashal@kernel.org> References: <2026012011-happily-padded-148c@gregkh> <20260121025228.1153601-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 eb93b326db4e1..ed92101b2d478 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1166,7 +1166,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