* [PATCH] nvme: unblock ctrl state transition for firmware update
@ 2025-05-02 8:58 Daniel Wagner
2025-05-06 13:47 ` Sagi Grimberg
2025-05-07 7:02 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Daniel Wagner @ 2025-05-02 8:58 UTC (permalink / raw)
To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
Cc: linux-nvme, linux-kernel, Guenter Roeck, Daniel Wagner
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 <linux@roeck-us.net>
Closes: https://lore.kernel.org/all/0134ea15-8d5f-41f7-9e9a-d7e6d82accaa@roeck-us.net
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
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 eb6ea8acb3cca7421d7fb218e51d855f2c056825..ac53629fce68d4c8c12cddc112986289eae79b43 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4493,7 +4493,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);
---
base-commit: ebd297a2affadb6f6f4d2e5d975c1eda18ac762d
change-id: 20250502-nvme-fix-fw-update-156bdd02ed2b
Best regards,
--
Daniel Wagner <wagi@kernel.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] nvme: unblock ctrl state transition for firmware update
2025-05-02 8:58 [PATCH] nvme: unblock ctrl state transition for firmware update Daniel Wagner
@ 2025-05-06 13:47 ` Sagi Grimberg
2025-05-07 7:02 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2025-05-06 13:47 UTC (permalink / raw)
To: Daniel Wagner, Keith Busch, Jens Axboe, Christoph Hellwig
Cc: linux-nvme, linux-kernel, Guenter Roeck
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: unblock ctrl state transition for firmware update
2025-05-02 8:58 [PATCH] nvme: unblock ctrl state transition for firmware update Daniel Wagner
2025-05-06 13:47 ` Sagi Grimberg
@ 2025-05-07 7:02 ` Christoph Hellwig
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2025-05-07 7:02 UTC (permalink / raw)
To: Daniel Wagner
Cc: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg,
linux-nvme, linux-kernel, Guenter Roeck
Thanks,
applied to nvme-6.15.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-07 7:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 8:58 [PATCH] nvme: unblock ctrl state transition for firmware update Daniel Wagner
2025-05-06 13:47 ` Sagi Grimberg
2025-05-07 7:02 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox