]> www.infradead.org Git - users/willy/xarray.git/commitdiff
nvme: start keep-alive after admin queue setup
authorHannes Reinecke <hare@suse.de>
Tue, 24 Oct 2023 06:13:37 +0000 (08:13 +0200)
committerKeith Busch <kbusch@kernel.org>
Mon, 6 Nov 2023 17:16:10 +0000 (09:16 -0800)
Setting up I/O queues might take quite some time on larger and/or
busy setups, so KATO might expire before all I/O queues could be
set up.
Fix this by start keep alive from the ->init_ctrl_finish() callback,
and stopping it when calling nvme_cancel_admin_tagset().

Signed-off-by: Hannes Reinecke <hare@suse.de>
Tested-by: Mark O'Donovan <shiftee@posteo.net>
[fixed nvme-fc compile error]
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c
drivers/nvme/host/fc.c

index 97441d02292643c6af9992badc9daf9b2558532d..75a1b58a7a436fdac43945d0ded8ea989224cf3c 100644 (file)
@@ -483,6 +483,7 @@ EXPORT_SYMBOL_GPL(nvme_cancel_tagset);
 
 void nvme_cancel_admin_tagset(struct nvme_ctrl *ctrl)
 {
+       nvme_stop_keep_alive(ctrl);
        if (ctrl->admin_tagset) {
                blk_mq_tagset_busy_iter(ctrl->admin_tagset,
                                nvme_cancel_request, ctrl);
@@ -3200,6 +3201,8 @@ int nvme_init_ctrl_finish(struct nvme_ctrl *ctrl, bool was_suspended)
        clear_bit(NVME_CTRL_DIRTY_CAPABILITY, &ctrl->flags);
        ctrl->identified = true;
 
+       nvme_start_keep_alive(ctrl);
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(nvme_init_ctrl_finish);
@@ -4346,7 +4349,6 @@ void nvme_stop_ctrl(struct nvme_ctrl *ctrl)
 {
        nvme_mpath_stop(ctrl);
        nvme_auth_stop(ctrl);
-       nvme_stop_keep_alive(ctrl);
        nvme_stop_failfast_work(ctrl);
        flush_work(&ctrl->async_event_work);
        cancel_work_sync(&ctrl->fw_act_work);
@@ -4357,8 +4359,6 @@ EXPORT_SYMBOL_GPL(nvme_stop_ctrl);
 
 void nvme_start_ctrl(struct nvme_ctrl *ctrl)
 {
-       nvme_start_keep_alive(ctrl);
-
        nvme_enable_aen(ctrl);
 
        /*
index a15b37750d6e931b0a875058cda6868034a642d9..49c3e46eaa1eee13b1174044104072dc6390990f 100644 (file)
@@ -2530,6 +2530,12 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
         * clean up the admin queue. Same thing as above.
         */
        nvme_quiesce_admin_queue(&ctrl->ctrl);
+
+       /*
+        * Open-coding nvme_cancel_admin_tagset() as fc
+        * is not using nvme_cancel_request().
+        */
+       nvme_stop_keep_alive(&ctrl->ctrl);
        blk_sync_queue(ctrl->ctrl.admin_q);
        blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
                                nvme_fc_terminate_exchange, &ctrl->ctrl);