Skip to content

Commit 4f05964

Browse files
igawsmb49
authored andcommitted
nvme: unblock ctrl state transition for firmware update
BugLink: https://bugs.launchpad.net/bugs/2115252 [ Upstream commit 650415f ] 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: d2fe192 ("nvme: only allow entering LIVE from CONNECTING state") Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Daniel Wagner <[email protected]> Closes: https://lore.kernel.org/all/[email protected] Reviewed-by: Keith Busch <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 5c8741e commit 4f05964

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/host/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,8 @@ static void nvme_fw_act_work(struct work_struct *work)
44934493
msleep(100);
44944494
}
44954495

4496-
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
4496+
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) ||
4497+
!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
44974498
return;
44984499

44994500
nvme_unquiesce_io_queues(ctrl);

0 commit comments

Comments
 (0)