Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1467269pxy; Mon, 2 Aug 2021 02:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3gXepgr1vgshM774bVnXqR2oZfqO3poWXEt7jQBRHg/RQKo9xMOen70d88uZwb9kasxOi X-Received: by 2002:a6b:14ca:: with SMTP id 193mr845749iou.206.1627895737188; Mon, 02 Aug 2021 02:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627895737; cv=none; d=google.com; s=arc-20160816; b=QOlKmGn65QW9Ek1AA0imyrxHLEMOl3jADqJpjWiI9/J2usMuBeJfcb6rcHPNAIhkR6 CQFuVLVgMvl0kn3UR1hrZ/F8ghd+qGoq/JuM9SGWr0NzSZjI66Wp/tiE/+twIXJ7zlwT YNOIEaQRBAcg5Hnk42+XmlDHopgNIkKwTPN9rOxSPwcFD7pLI8VOO9IkVzNlrTjOr0o2 zqJctke9V2LoTmyMTxOi45n1CMXi4VyB4QaAem+15f3l6O2TZQxjd9b4GqTr9wxAhg9C JIW+P71E4L/zOoU8IjmQKLnpVWESxSTaJViVVRQ1+YKR4uuogva5v4gMluBeMdlPEsJ8 IEdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=vuFuvhKlUfFYXf6FmlE9wh0koABi63V3tWPF92dXgDs=; b=WSZl9iEyec2m5an0HWsbdQnAb2x0iiSOXBeLOUcph4aieHtnHRsJw6YL5SaJL+9x3Y ofn2M/so+kbAZKtF108rwueik8WCQiHLU282R9wWL8J7dik7zqMJM+WMhQv+C8MTp1dp /DV755ZsTX5USG8j1CzywAUHe8mpfSGMnP9Jh1PuYbGbMiaPwh/ptR1kL5ldWxIaCd/j OGtlETPQSlM/75CVWLoraZ3FqRIB2Neoqppp2VyZ5ASKiwn83N18NtIEo0DHkKh583ZJ xohe0oBiwtVW+gVU64WIqgvDKsHZ6fgUDo13nr5gBqk4XpMcjHfx7blHBpA299lQgdcS csiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tFICB7oD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Y8wMmtqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si6248609jaj.83.2021.08.02.02.15.26; Mon, 02 Aug 2021 02:15:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=tFICB7oD; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Y8wMmtqN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233020AbhHBJOv (ORCPT + 99 others); Mon, 2 Aug 2021 05:14:51 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:44244 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232878AbhHBJOc (ORCPT ); Mon, 2 Aug 2021 05:14:32 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id DAA6C21F93; Mon, 2 Aug 2021 09:14:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627895661; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vuFuvhKlUfFYXf6FmlE9wh0koABi63V3tWPF92dXgDs=; b=tFICB7oD3cVVuZqLA+Cahm07iv50wIWEbEYzsqSy+lABYBcZeiarz4YyRPtL6v07cEZd02 3txH6P+gWR7cofehHMauug2yeQ67lf06kSrWg4CFRXcxDEEumJhDukmQj7sG2YiJJEOrT5 dQf7wYcdlkWzyg7todZL/zIkwB+GI4E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627895661; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vuFuvhKlUfFYXf6FmlE9wh0koABi63V3tWPF92dXgDs=; b=Y8wMmtqNir+qc/FI7Gms5YlHXzkdhTOWbVe0nRZr+TmiKTz5WgTpSfYVGiFdqP02p6sA1n R/V7I1IR9F7qflBg== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id D11A3A3BB4; Mon, 2 Aug 2021 09:14:21 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 18ED7518C093; Mon, 2 Aug 2021 11:14:21 +0200 (CEST) From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: James Smart , Keith Busch , Ming Lei , Sagi Grimberg , Hannes Reinecke , Wen Xiong , James Smart , Daniel Wagner Subject: [PATCH v4 6/8] nvme-fc: fix controller reset hang during traffic Date: Mon, 2 Aug 2021 11:14:17 +0200 Message-Id: <20210802091419.56425-7-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210802091419.56425-1-dwagner@suse.de> References: <20210802091419.56425-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Smart commit fe35ec58f0d3 ("block: update hctx map when use multiple maps") exposed an issue where we may hang trying to wait for queue freeze during I/O. We call blk_mq_update_nr_hw_queues which may attempt to freeze the queue. However we never started queue freeze when starting the reset, which means that we have inflight pending requests that entered the queue that we will not complete once the queue is quiesced. So start a freeze before we quiesce the queue, and unfreeze the queue after we successfully connected the I/O queues (the unfreeze is already present in the code). blk_mq_update_nr_hw_queues will be called only after we are sure that the queue was already frozen. This follows to how the pci driver handles resets. This patch added logic introduced in commit 9f98772ba307 "nvme-rdma: fix controller reset hang during traffic". Signed-off-by: James Smart CC: Sagi Grimberg [dwagner: call nvme_unfreeze() unconditionally in nvme_fc_recreate_io_queues() to match the nvme_start_freeze()] Tested-by: Daniel Wagner Reviewed-by: Daniel Wagner --- drivers/nvme/host/fc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 133b87db4f1d..b292af0fd655 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2486,6 +2486,7 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues) * (but with error status). */ if (ctrl->ctrl.queue_count > 1) { + nvme_start_freeze(&ctrl->ctrl); nvme_stop_queues(&ctrl->ctrl); nvme_sync_io_queues(&ctrl->ctrl); blk_mq_tagset_busy_iter(&ctrl->tag_set, @@ -2966,8 +2967,8 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl) return -ENODEV; } blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues); - nvme_unfreeze(&ctrl->ctrl); } + nvme_unfreeze(&ctrl->ctrl); ret = nvme_fc_create_hw_io_queues(ctrl, ctrl->ctrl.sqsize + 1); if (ret) -- 2.29.2