Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4520243pxv; Tue, 20 Jul 2021 05:49:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhckRvnVkcy6MlhSDXMFSRWeat0OlX8j5ZCB8dadmOMOkuZHuFGncyUPLWjXFz4++0Nmmy X-Received: by 2002:a50:ee15:: with SMTP id g21mr40239120eds.334.1626785373898; Tue, 20 Jul 2021 05:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626785373; cv=none; d=google.com; s=arc-20160816; b=zfm9nerAjLPW2f6LIJVvzxOj+1aGfkGYIQtN38sd2Kw7wQbqjAUmFq0FfiL+irNlo/ mBBi/zEKX88lXUxlh9nkT9Ss9hpluiTYPCHXIuR96F0oaCL4lRRVZ/S+rAU+mtiLcVDg 2UF+73HUeL7U2R/l56oAkgsM6NYr/n8vVirc2N2ixCahFwiCl725KnGykA4KvXmqpMl8 lCz+C3RkVEacztgPvmZTW89xfbP70HF0gWWfM+iHzPeF44NFpTEDBI9X5EXRpWEXhuSA t1ljYzHAJZ8ZbsA8opaA2OgtfkRTKfNXs6Hi3+843n7PXIxInsYLnFLlGnPsfh/o+Ai2 evIA== 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=5k7XNc5+yPEatIcV2+Rzvnk7tPH3TwekV1DDGT6cYwk=; b=kxsF08mA7IV24Tcui7pRFkMXB3h7z54SMXNYzux+cJ7T/dv6dkh2VzwnYRHbtNZ71T /ZSl1PQl7S22NxP+ldOhl6GuXMxGpEksnx/7JBjT3poqwzc8sQNT9lL7SP7yRM2Ihyv4 c1t9xYcU4qEBwpW0x9/JbXBMtf8l4pSWFbMXmhCuXh7zdAuW80e+VF/qXkINV97qztA+ /Pdo8IEbb3mHo3K0rLogpxBfH0hft/ztKXwxaUo3vR105YxeuKSPCJG+P/fqGf77FEiw awrSUPeYv90b3ICmRxFKyoq/Ue4gBwaD499lVfMrtfEfbqiDZKwRtfS+ZCxkariX4mm9 rPqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=BUHtxkYh; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=iWR0LBvF; 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 cw2si21371420ejc.730.2021.07.20.05.49.10; Tue, 20 Jul 2021 05:49:33 -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=BUHtxkYh; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=iWR0LBvF; 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 S229944AbhGTME1 (ORCPT + 99 others); Tue, 20 Jul 2021 08:04:27 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51764 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238089AbhGTMDV (ORCPT ); Tue, 20 Jul 2021 08:03:21 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E226F202DD; Tue, 20 Jul 2021 12:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1626785038; 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=5k7XNc5+yPEatIcV2+Rzvnk7tPH3TwekV1DDGT6cYwk=; b=BUHtxkYh5vULvVX1wWG9DVxV3O5daCs1I888sVXWnOqRPya6jvu7pJ0pdFFz0NX5De+XqF XJfo4wqjicz++ZDXU1VaMck7xmM0wZjCJyzCMoUxsXtjeX4vma6fW6FeEqQ8nOnIUUPCTF pjRvv+dKUNtNlpFBRVXyyAyJb9wG13c= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1626785038; 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=5k7XNc5+yPEatIcV2+Rzvnk7tPH3TwekV1DDGT6cYwk=; b=iWR0LBvFla0McKz4TeyppaZ8OAgaHEp6CfjYHrJLZYQWdZ0JUGfJHiNNyPkhDIuNEiDm4U bFuJDzhqiidK3wAQ== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id D1DDFA3BAD; Tue, 20 Jul 2021 12:43:58 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 18D1E5171932; Tue, 20 Jul 2021 14:43:58 +0200 (CEST) From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, James Smart , Keith Busch , Ming Lei , Sagi Grimberg , James Smart , Daniel Wagner Subject: [PATCH v3 6/6] nvme-fc: fix controller reset hang during traffic Date: Tue, 20 Jul 2021 14:43:53 +0200 Message-Id: <20210720124353.127959-7-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210720124353.127959-1-dwagner@suse.de> References: <20210720124353.127959-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 Tested-by: Daniel Wagner Reviewed-by: Daniel Wagner --- drivers/nvme/host/fc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 112e62cd8a2a..ad3344f6048d 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, -- 2.29.2