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 3DA1B255222; Mon, 12 May 2025 18:12:49 +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=1747073570; cv=none; b=KTyDe5kbGql83K/0Ue/BoB+UWNEKjaKGLjuIEf4Vy4Hs68/2ni/SsOCre3braV9sMlNCsiinf/ujGbkDjaleBpFzuWNJ48rdtjYnGIPkREYRHdmr2hqGuRBuqj0Jwi6Z3sEk57vjMQRM6hC9QpNbCA5n8XGVKSThqLaX4oaD5Ig= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747073570; c=relaxed/simple; bh=lc34TpETbAcTQ4tkt6yjgM2Ui3pAUlRg87tETkGXO7I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T93+RApdUDP/Y/W2CmjlCk4dEjFt56At1YbZEackMOVb79Ubuu6EK4UTakFiNbFT35mq9PVNK0dnkfmYQPTW17ikNPeKarWHGMgqAiksj8SIkOcyWG0EUK+Q8MlhSAELHqo/Kfvbm8LndW917Sa5SIO3otPAxOTARn37EOG8RgA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UxyxqdeZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UxyxqdeZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40712C4CEEF; Mon, 12 May 2025 18:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747073569; bh=lc34TpETbAcTQ4tkt6yjgM2Ui3pAUlRg87tETkGXO7I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UxyxqdeZ9fpXODrFt4sl6rg9nuZ9Duhmd9Fwk8DVPfkQOzRgRohORSJpl6x/g7kxN c7y7kZTIb+00XPVx5CigyoQgswdrJ/HZuVMywsFBZhksPQ4AM4KHGPwVErhXLMIbjU K0HsiBnIfyf7U9hXl3IY4VQoh7+4gZjC23DzGifY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guenter Roeck , Daniel Wagner , Keith Busch , Sagi Grimberg , Sasha Levin Subject: [PATCH 6.6 088/113] nvme: unblock ctrl state transition for firmware update Date: Mon, 12 May 2025 19:46:17 +0200 Message-ID: <20250512172031.263243547@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512172027.691520737@linuxfoundation.org> References: <20250512172027.691520737@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daniel Wagner [ Upstream commit 650415fca0a97472fdd79725e35152614d1aad76 ] The original nvme subsystem design didn't have a CONNECTING state; the state machine allowed transitions from RESETTING to LIVE directly. With the introduction of nvme fabrics the CONNECTING state was introduce. Over time the nvme-pci started to use the CONNECTING state as well. Eventually, a bug fix for the nvme-fc started to depend that the only valid transition to LIVE was from CONNECTING. Though this change didn't update the firmware update handler which was still depending on RESETTING to LIVE transition. The simplest way to address it for the time being is to switch into CONNECTING state before going to LIVE state. Fixes: d2fe192348f9 ("nvme: only allow entering LIVE from CONNECTING state") Reported-by: Guenter Roeck Signed-off-by: Daniel Wagner Closes: https://lore.kernel.org/all/0134ea15-8d5f-41f7-9e9a-d7e6d82accaa@roeck-us.net Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Guenter Roeck Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c6b0637e61deb..6e2d0fda3ba4a 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4156,7 +4156,8 @@ static void nvme_fw_act_work(struct work_struct *work) msleep(100); } - if (!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)) return; nvme_unquiesce_io_queues(ctrl); -- 2.39.5