Skip to content

Commit e7cb5c3

Browse files
nvme: unblock ctrl state transition for firmware update
JIRA: https://issues.redhat.com/browse/RHEL-95382 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 <linux@roeck-us.net> Signed-off-by: Daniel Wagner <wagi@kernel.org> Closes: https://lore.kernel.org/all/0134ea15-8d5f-41f7-9e9a-d7e6d82accaa@roeck-us.net Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Guenter Roeck <linux@roeck-us.net> (cherry picked from commit 650415f) Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
1 parent 17afeb8 commit e7cb5c3

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
@@ -4449,7 +4449,8 @@ static void nvme_fw_act_work(struct work_struct *work)
44494449
msleep(100);
44504450
}
44514451

4452-
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
4452+
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) ||
4453+
!nvme_change_ctrl_state(ctrl, NVME_CTRL_LIVE))
44534454
return;
44544455

44554456
nvme_unquiesce_io_queues(ctrl);

0 commit comments

Comments
 (0)