Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp25545pxk; Tue, 15 Sep 2020 16:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJRJIt7C8HIA/cvZmL3BWqu+tdYcy5TzyJDwah5BVExieOUS1nW3mYdVZAY8CsLdIbatUc X-Received: by 2002:a17:906:f90c:: with SMTP id lc12mr22271201ejb.104.1600213491290; Tue, 15 Sep 2020 16:44:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600213491; cv=none; d=google.com; s=arc-20160816; b=Tr/XyqEClAalzwAjiO8IldyN3VJ72+gwS5YgFnSwVAyZqPi/vZWFOSQttC1UQk7sfd oLhkjhP2wUQ/9L42mcOOy4ye42rz0lAEhLGmk7LAfTfVCXE6cNwdsP3zG726usrcap05 8IafXiVwMIx2V2lU8GS5yf3lKXYJU7kLVZ1a+j5OKCLwqWnYi6N6sagTilRPVCcotZ5O O1dCE/e4otN3XjQSgcfIqltc+hfC8KjQjrhAAg9AV0yN4H/Izt+CvYvFg0vTjJZ1I3Tb c4+KAb9XtOXm/mCYkgruUr0YV29WivWckztJRCLVQ1AgrFHpdBpwemxS+e5RaTFquThs 4VaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZSj2GbsvUi9YdEoy0bnjy5df3wvRaDuqvpm3zjKydrI=; b=T5U6H2/ubk7VpMumMHsDC6NS7ZWXNLkJ38FeiwatJvF0FxZWkTM/Ah2b8rA4DkPVTy +9X6nbgdy66Kx3fo4mCunTGd7IJxRcGLy7icYTgHEtLAZpBTu2ltHn5IlTZRkdGgJTOa YGAD9YjTNRmLJLVcUFdPoZB80IOk55Fg1AeOocKrJ+0y8R7eR0cLxczbvf9GbTCkju8+ IH4kCgqzjv9xtjl0repGr0qcJl5CII2fQFKB9ssqaxve2lSdUv8CjAyH2zlSbSm3GDFP acF/NO365Ha4/44M4Lzx8WpmDtGJAN0MHna7GrMbSI0xiRZ+S7OcC5I6RQmsQi2CmxEF 9IAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HIpeV2bK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si3999783ejj.595.2020.09.15.16.44.29; Tue, 15 Sep 2020 16:44:51 -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=@kernel.org header.s=default header.b=HIpeV2bK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727436AbgIOXlZ (ORCPT + 99 others); Tue, 15 Sep 2020 19:41:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:47680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727066AbgIOOem (ORCPT ); Tue, 15 Sep 2020 10:34:42 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C25B622206; Tue, 15 Sep 2020 14:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179359; bh=4taMP0KtAQ3FpoKjx8CsPOo7xUU2+5CQiZzdAwWs+Lk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HIpeV2bKR0ryCoqootT88yRhyZTTSb28vpxnjrBz9B40x0Y34VTbVk45XVYIyCxn0 6EJxaJC1Y5CWWTT60DRS0FYCDxCBvhAXSYwo47g8MgwzB+M5PQ+hqFIsQOVjh7xyte tl7Cx2Zq5kTgYckmeN7tkUhdaEbyPzLduGIKT7nA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Sasha Levin Subject: [PATCH 4.19 28/78] nvme: have nvme_wait_freeze_timeout return if it timed out Date: Tue, 15 Sep 2020 16:12:53 +0200 Message-Id: <20200915140634.986905823@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sagi Grimberg [ Upstream commit 7cf0d7c0f3c3b0203aaf81c1bc884924d8fdb9bd ] Users can detect if the wait has completed or not and take appropriate actions based on this information (e.g. weather to continue initialization or rather fail and schedule another initialization attempt). Reviewed-by: Christoph Hellwig Signed-off-by: Sagi Grimberg Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 3 ++- drivers/nvme/host/nvme.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 0d60f2f8f3eec..1b0133564f0ca 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3726,7 +3726,7 @@ void nvme_unfreeze(struct nvme_ctrl *ctrl) } EXPORT_SYMBOL_GPL(nvme_unfreeze); -void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout) +int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout) { struct nvme_ns *ns; @@ -3737,6 +3737,7 @@ void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout) break; } up_read(&ctrl->namespaces_rwsem); + return timeout; } EXPORT_SYMBOL_GPL(nvme_wait_freeze_timeout); diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index cc4273f119894..9bada68b4bd0c 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -438,7 +438,7 @@ void nvme_start_queues(struct nvme_ctrl *ctrl); void nvme_kill_queues(struct nvme_ctrl *ctrl); void nvme_unfreeze(struct nvme_ctrl *ctrl); void nvme_wait_freeze(struct nvme_ctrl *ctrl); -void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout); +int nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout); void nvme_start_freeze(struct nvme_ctrl *ctrl); #define NVME_QID_ANY -1 -- 2.25.1