Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp285328pxv; Thu, 8 Jul 2021 02:30:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH5TjzbEtrzg2NTRwr1an92LKaOuCgDIef2eMD+h2inStoVs8esaX627nFUPwrPAQVcPm6 X-Received: by 2002:a05:6402:1385:: with SMTP id b5mr22224618edv.276.1625736637281; Thu, 08 Jul 2021 02:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625736637; cv=none; d=google.com; s=arc-20160816; b=kN2uJwoJMK8ry+i4HCCAXnktLEMIi3S+z7UrK2ofs/u4WyWzG+2y3oF65rre+Dt5uV PLdaiZHoCi3YP4rLTn/1p1hzVpFkGMnCB9EMIhkrxSkE/kBO+2Pd5L9ysLnN/k+okJ1V 3luhVjoz4FiP1CVepJBUYtt4FleW0AebmVBqMWyPrv2CHzT7z91bodCeYzdP1BMuBT+k Ibi9ik6GvVRwvurRryUvoLMuZQzSGqMCzLB3Wtyk1jDqlJrOc7ztXzg0Np6TW1dtFoiH P3g2r1VZR31xa6IYSfLyQVpaSJuFaHjBoO5bU0NJ++CgPYPTJ4B1Nc4UWY6Dv+y+TvAO lP3w== 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=nXMw5odYC5q3FtwoS0u2DjqK6fjPg8pZT74QTDkWFwE=; b=zApdDT81gKqDLgLtTt8xeAvvbeEAXgUDr7kVZWBwo+OwrOjOFtmd5Qe77OxVf2GiEv TcBrKjyVmHiu7t1CagW71frlTKat7S1sdD88DeJw4hAU4exWeBCdl39GP9eXhb9Eeq8q ZwbvPP/sN3uP7WjRA/Txu2wJb8Pvou5z7JcttGLBhn8FdBfRRXw1IaxovbeqrkEkDXub ortpL0/u8RhCw+gEsXl55yqoInt28L7Lgz+eJFC0E8KNDr5bLfa3jQu9MipTs3xq6yvM 7a9bq158YcbiQGLT32iikb5mjWctGW7B5oKVZlNuGDVSyefsHRMwjTDiFNSKUob6f2sx 9+Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Qv55vqoa; dkim=neutral (no key) header.i=@suse.de; 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 d26si2695248edr.461.2021.07.08.02.30.15; Thu, 08 Jul 2021 02:30: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=Qv55vqoa; dkim=neutral (no key) header.i=@suse.de; 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 S231441AbhGHJa7 (ORCPT + 99 others); Thu, 8 Jul 2021 05:30:59 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:36018 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231321AbhGHJav (ORCPT ); Thu, 8 Jul 2021 05:30:51 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7BEAE21FD1; Thu, 8 Jul 2021 09:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625736488; 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=nXMw5odYC5q3FtwoS0u2DjqK6fjPg8pZT74QTDkWFwE=; b=Qv55vqoafuG/M0TBtVGf+0hCC9x0VbDwAz/osL6gh0wU4Xh2uThmZPoUDKAaUIUM4gnjsC elaDmHJnKpVbQwSF6pLR9+fBOzPl2swU3gAp9BRVl6POPPJ2G7Gkcp+6YZnyXWUUR7waU5 iZpVfoYcSbFavPqJ6xJQxOKSEEzXIzw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625736488; 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=nXMw5odYC5q3FtwoS0u2DjqK6fjPg8pZT74QTDkWFwE=; b=GOcRbaYY7m+h3QxqYXNghwggvQNfKf6YAQjX/OeGUG5foxRxP20pywvX7MM6428OxvZPcR 9xJxgEuwWQT+EtBw== Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id 71FDCA3B8A; Thu, 8 Jul 2021 09:28:08 +0000 (UTC) Received: by adalid.arch.suse.de (Postfix, from userid 17828) id 63BBD5171152; Thu, 8 Jul 2021 11:28:08 +0200 (CEST) From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, James Smart , Keith Busch , Jens Axboe , Ming Lei , Sagi Grimberg , Daniel Wagner , James Smart Subject: [PATCH v2 4/5] nvme-fc: Wait with a timeout for queue to freeze Date: Thu, 8 Jul 2021 11:27:54 +0200 Message-Id: <20210708092755.15660-5-dwagner@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210708092755.15660-1-dwagner@suse.de> References: <20210708092755.15660-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 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 d0eb81387d4e..8e1fc3796735 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2956,7 +2956,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