From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ED4BC07E99 for ; Thu, 8 Jul 2021 09:28:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DD17619CB for ; Thu, 8 Jul 2021 09:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231449AbhGHJbA (ORCPT ); Thu, 8 Jul 2021 05:31:00 -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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EBE2C07E96 for ; Thu, 8 Jul 2021 09:29:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E2ED619CB for ; Thu, 8 Jul 2021 09:29:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E2ED619CB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5azUEW50oxQml8HvoBD54hOUMDnLHnB/iWKQuj4zINE=; b=Ad4wtaXjD3F3+K VvMFYBysvpl7omLAVlJD20cCz/8x4cLMKoXLkqqAEuL31Y/YdGvsQXCFP0iYScfaYokPtYwhwzCyI i5Bc7ygVukJKgrzsUtKCt+d74axxvh0nEJOYoa88dCaWn1+A4KzDhqBRSsu/yjVI6wTd3150FedTn i4jXe1njOMwFC5gAFiiNOjONrladiO5KHPUX/2QzEIFzkJouHL/U5UrkYSZntQKsr5zeL5THBmxp4 VhSSxwGKCStHmX3p1s8Hh3jELLr4H5Ithcpx3wIAJP8TUo32951Vz3/njKw04WUfGJYpv8PF67j2q QYdqolF3ancaveH8lzlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1QLh-00GRQI-5Y; Thu, 08 Jul 2021 09:29:37 +0000 Received: from smtp-out1.suse.de ([195.135.220.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m1QKJ-00GQpB-R2 for linux-nvme@lists.infradead.org; Thu, 08 Jul 2021 09:28:14 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210708_022812_053828_9DEBDA16 X-CRM114-Status: GOOD ( 11.92 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.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 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme