Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4155011pxk; Tue, 8 Sep 2020 12:05:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdis4wOAraEE5PrEyMPdvoZsHL6CEy+aEMuDKb0fd0yEp/yvpTNTExT1Tqa55sMayJ9obI X-Received: by 2002:a17:906:f11:: with SMTP id z17mr9125011eji.88.1599591912374; Tue, 08 Sep 2020 12:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599591912; cv=none; d=google.com; s=arc-20160816; b=qDYvnPDNncU362taDoNyV2tlpzYvNOmhgxW+CHJiHOQpPMWtiYi6FKbeABN6vcYH85 wFe+U9U0HUjasSzk8EjLt+l7CMZntp6ziDr/9301TA5bzV7jjOXXFKd07lznghx1Y9oq 8Q5uhjpBHRCmTxDWvwfIIcFQ8QecnUbmVmT8bCzfcXw/eR6VIokCKfM8+qi+BtBK44o1 jM1uz2y3hXMos+GDPgtxgnWAz7PiZjuIpf0uWToZGsPEpl5fsAtjD9cpFpsbxhizMpti mh+yDD9+GzpGUvjQS2C0qEzvbPgvcoov361yKpD4pECnd5UxcAxSrHempn8F0Y55LGSL XO+g== 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=+XXdyhnJmnFyhf4AybwagsWmSSWS1qt+Ro+/oGoxCFo=; b=Wb4NwDhNav9nZRVhYEc+HHFtU19EhJy8onTTU1EemeYTMN2Ea7pZfKF4gLa1FYtvwl v5CBCMiZs8J7rkJfUNIHANP0sXSZcKZ+Vbc6SVp8hInhFTyjgO1eL+Kfe4OKKqIIriO5 IKUoTdAi6hRFSumbxMuNry1hGq4yymkeyvO9tOd1RS/R1j2bXTEkwFsroUEyKQrTpdOW nf90J56botLNvCaUKs0pCc87S868OP9BELrOsJetZpthBbwsGQi8oEHyWzQNpt+n5Ohf IKlwadV53c8yz2gjimIrj5pWJf7yMflXKSuUlOgxxHyMnu2djL29KQDrqOgcQTPyIWhM kgFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QHQGxcaF; 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 o14si12117993ejc.648.2020.09.08.12.04.49; Tue, 08 Sep 2020 12:05:12 -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=QHQGxcaF; 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 S1731572AbgIHTBe (ORCPT + 99 others); Tue, 8 Sep 2020 15:01:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:52606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731291AbgIHQIC (ORCPT ); Tue, 8 Sep 2020 12:08:02 -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 DD66123EF3; Tue, 8 Sep 2020 15:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599580067; bh=ObXwBHcpH2/Zv36wN1h9V35sVGYuyTclfNAs+hcl7B8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QHQGxcaFmV/woEpGy3x/xSSRVidJS2Ng9gtAxADnXaRgs4PeSgm+c2ZgzmpuX/GU4 ufDo3sOMoQKEbol+FMvGM0duBQwzOD8Xi4RPk/2YF72GykpNxFcd2lu6LujsuRsaxx E32Cw0TCY3p2VVPlJFFFzz/Mu0iGCgchEKmHUw00= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit Engel , Sagi Grimberg , Jens Axboe , Sasha Levin Subject: [PATCH 4.19 09/88] nvmet: Disable keep-alive timer when kato is cleared to 0h Date: Tue, 8 Sep 2020 17:25:10 +0200 Message-Id: <20200908152221.558685264@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152221.082184905@linuxfoundation.org> References: <20200908152221.082184905@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: Amit Engel [ Upstream commit 0d3b6a8d213a30387b5104b2fb25376d18636f23 ] Based on nvme spec, when keep alive timeout is set to zero the keep-alive timer should be disabled. Signed-off-by: Amit Engel Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/target/core.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index 776b7e9e23b9e..f28df233dfcd0 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -307,6 +307,9 @@ static void nvmet_keep_alive_timer(struct work_struct *work) static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl) { + if (unlikely(ctrl->kato == 0)) + return; + pr_debug("ctrl %d start keep-alive timer for %d secs\n", ctrl->cntlid, ctrl->kato); @@ -316,6 +319,9 @@ static void nvmet_start_keep_alive_timer(struct nvmet_ctrl *ctrl) static void nvmet_stop_keep_alive_timer(struct nvmet_ctrl *ctrl) { + if (unlikely(ctrl->kato == 0)) + return; + pr_debug("ctrl %d stop keep-alive\n", ctrl->cntlid); cancel_delayed_work_sync(&ctrl->ka_work); -- 2.25.1