Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4117933pxk; Tue, 8 Sep 2020 11:08:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKsOUsEsww+189AXWsCRPzZvV8bGa934WhO5NDWlKRyPfBjGawQjn6oCApCqxDOfTuhgEG X-Received: by 2002:a17:906:934e:: with SMTP id p14mr9088466ejw.348.1599588524904; Tue, 08 Sep 2020 11:08:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599588524; cv=none; d=google.com; s=arc-20160816; b=wwkSwxhPuziZ3Siq7ohdOjIwmnsvDP9VsWgc+nTc7p4WzkxTY2mzhmqMwArfcdgq3h dVZDLqFFBgEp620W9Uc/jLJMxf/OMvqy0okfCpYrOQeZnAcIbb/2IPAYeA7rrSkhaj3O GwfjYA/kDQa5T/a3yJQSP/N1tUBqmUZKfyMmjuo+oD2qxwHOM7y+/+sHM558GE0J8wF9 dnGIznUmC6xO4KUtulfFYCuhkoApHmIgzP8uuqelZ7SnC6CCLQfq8k653BXSxeRriM8T sjXtdD/T5RrTVV1LwPpePVl55DXip3YKYO28vCF5IeWuHuTEefHHgGPHaLMmEkhzgT4a 9xUw== 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=+POM8PK2/rsZl6i4Vt9EXMhCA90cPJXMimw8lFnBtH4=; b=NFOWNegLTBvQRg725ZCDFU8CC2kVatU779JwIS4B1chw6SXQg7j1jT5TNvZ6TiHLvU pFOJjj+BV/a00crs3Fk2+08OIYvI1HxCKovxOPq6mKh9MsQslqlWR/EpZIRlRuxHxUi4 wamIONOoRHMjdHTOvZnTuEEUo9XYBqDMVJl7mXJXZb9UvFQ5/fKWD/7AUgDBkRt3pbLf yLxbfLc70MpYg/P757GIKURTyE/gEYbzs3SzDjrGk1smwaNTgKfDGTMKZCoIS9bFmPiA tupAgd4b3lPeJhfPH3JB3MRKBKqwnSW37BIpzohyAg/G5sZki7T5zmUcqSPIZI5lsyFC 69dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c+wRlImR; 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 v20si1179467eje.120.2020.09.08.11.08.22; Tue, 08 Sep 2020 11:08:44 -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=c+wRlImR; 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 S1732222AbgIHSGS (ORCPT + 99 others); Tue, 8 Sep 2020 14:06:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:55072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731531AbgIHQMK (ORCPT ); Tue, 8 Sep 2020 12:12:10 -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 1A011247D4; Tue, 8 Sep 2020 15:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599580291; bh=eQe1wYGLHkgxe6Ouy//U4712xeQz8re6/WlsK2ceVuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c+wRlImRNKLDhI9HWjUYdgpHxWtvcBYhxXt6PRIe4n4M5WKpp+1M/CAeVRjid7fJ3 QpNtvsmMNqpDRiUs2qQevFE+ogOkD7efbvTomwRTQiEalsTAshtHtNdQL6IAW49bQe x1EbutwVzhntQpVq0FOsZvK9/YLHM7Z3lJxYoKfg= 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.14 06/65] nvmet: Disable keep-alive timer when kato is cleared to 0h Date: Tue, 8 Sep 2020 17:25:51 +0200 Message-Id: <20200908152217.351593528@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152217.022816723@linuxfoundation.org> References: <20200908152217.022816723@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 09a39f4aaf821..d0be85d0c289a 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -208,6 +208,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); @@ -217,6 +220,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