Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1541496pxy; Mon, 2 Aug 2021 04:30:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxK7p8+2atun2sSJsm0cH251rVJtCVk/CO/jeVRBHucOZvvwpXeHACw5JwTawBIuqfQhNdx X-Received: by 2002:a05:6e02:1b03:: with SMTP id i3mr1357742ilv.160.1627903810009; Mon, 02 Aug 2021 04:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627903810; cv=none; d=google.com; s=arc-20160816; b=N+q0YY5FEQgV6UTf6FaJJiGC4iNbBffePJo29GwB9CPJFuDAQ30PvVWBaxQ3AS5xu+ VI572bgmd99IhAErwbDLy7Ywr0vp06gkUDokc+kqzhEmyYVb7b+7rWTtMnfY766AEfxE aEuIjstd7pQV4Y3njVEUfrbWhHuThE7cd/X//p6FMYB9Y5PztPgKySALpxs3SGDbqU23 PXAutXZYGoMi5O1ncz90rhjKb0vP3HlUESB6P7jppe0nRBtqtj1jtb+SM1se6KQDrGYJ Bf9vljh7+vEuNzX3HN85MDDvhD9NiyTTR7xw/h+xwe8chMkqjsuR+NTjFwhPquIOA4Ws +0FA== 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=ZjJI5ui+lBKS/7eBpcH/R0Ll/x+qjOPveqmd5g+MLNM=; b=NRjPV8VNnSkTi88kus9Iq9XqBTh7zQMkxXn4SPMXH2yvb+WnmXkr9hvLLkjZCpBjuN 8xBkUUHUyF0mk2MxWR2G69NgIMAW+SenSKP1vi/r1aG15628/vjhdQF2NaIwCz25lKCr +K7U8JmklAzyqr9x2WLNhajLZ4bxIowGlY4M8ayF8F/PNOuHjb6OMIsUyTKljG29J9W9 s/00t4FP2X4Ne0tNS6RKDgKFIDheKnoIsA+vGmEKO6HECms3KBhybw1efdU+cgPL/yOL 2KwbdTse7axS5EQ1U0SiXgikqGrK55eeL/R03DNAXnJYQymKdv7BTLYNxm7dDlYwlyk8 tg0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pmc7yMXN; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 i16si13149416jam.109.2021.08.02.04.29.58; Mon, 02 Aug 2021 04:30:09 -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=pmc7yMXN; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S233553AbhHBL1b (ORCPT + 99 others); Mon, 2 Aug 2021 07:27:31 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:51230 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233341AbhHBL1S (ORCPT ); Mon, 2 Aug 2021 07:27:18 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0F9A01FF78; Mon, 2 Aug 2021 11:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627903628; 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=ZjJI5ui+lBKS/7eBpcH/R0Ll/x+qjOPveqmd5g+MLNM=; b=pmc7yMXNZHzNxQM7hWeIfeCrTV5J9weTsC74c16kx5+kswdc1GaPgkxwNGldY815Nq7Ndp pQlu+V+k8SAN5h55bv0MSMCy3CrpnI11moyx1p4Z0QaWFZLGJ5YpvEFfqyf6uxAI5IKg6S MO1HBAbNRa/gbdktb6Ir3XJkPjqlfDY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627903628; 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=ZjJI5ui+lBKS/7eBpcH/R0Ll/x+qjOPveqmd5g+MLNM=; b=+HHyyclvZT9XLW/jlkq9yHca4+G68e0IuzCh2moB5zkZ6mrzICxLb30EycZs9dcIL6wPIi zks4sBsE5H6edEDw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 00BAFA3BC7; Mon, 2 Aug 2021 11:27:08 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id E1568518C0AC; Mon, 2 Aug 2021 13:27:07 +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 , Hannes Reinecke , Wen Xiong , Daniel Wagner , James Smart Subject: [PATCH v4 4/8] nvme-fc: Wait with a timeout for queue to freeze Date: Mon, 2 Aug 2021 13:26:54 +0200 Message-Id: <20210802112658.75875-5-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210802112658.75875-1-dwagner@suse.de> References: <20210802112658.75875-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not wait indifinitly for all queues to freeze. Instead use a timeout and abort the operation if we get stuck. Reviewed-by: James Smart Reviewed-by: Hannes Reinecke Signed-off-by: Daniel Wagner --- drivers/nvme/host/fc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 8a903769364f..dbb8ad816df8 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2955,7 +2955,14 @@ nvme_fc_recreate_io_queues(struct nvme_fc_ctrl *ctrl) dev_info(ctrl->ctrl.device, "reconnect: revising io queue count from %d to %d\n", prior_ioq_cnt, nr_io_queues); - nvme_wait_freeze(&ctrl->ctrl); + if (!nvme_wait_freeze_timeout(&ctrl->ctrl, NVME_IO_TIMEOUT)) { + /* + * If we timed out waiting for freeze we are likely to + * be stuck. Fail the controller initialization just + * to be safe. + */ + return -ENODEV; + } blk_mq_update_nr_hw_queues(&ctrl->tag_set, nr_io_queues); nvme_unfreeze(&ctrl->ctrl); } -- 2.29.2