Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp329915pxk; Fri, 11 Sep 2020 08:05:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDWiueJr9TJJp5Qri6IyrTNeSVhKULc9FOKqEzLCJy+5YznflFlLukED6mWocXslHaLhIy X-Received: by 2002:a17:907:264c:: with SMTP id ar12mr2597860ejc.80.1599836725967; Fri, 11 Sep 2020 08:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599836725; cv=none; d=google.com; s=arc-20160816; b=aBFlCZ/UBdi3NOupZ/HK8BRRS9M+w4UUfdMU4FFBoH6Ea7gBxBoPIWp8e6eP7f+6Ab wjrUKeYGVAzNDTksbryER3SI+Vi7m4NpxVDXmAG4orEsCz0fHvkb07B7FbHsM6XnOAo7 OLS/Q9LTBzAXC0+/wySiRH4tmDcLzQNm7kQSULH/Cxk3ImfzcIoy/RkS98SHj8QcTSKi xZp5ui2oyjDhzFuUej99jcTJQ8ks/NTDulwgWfWNbilqsplCHvcFD4D3xDGr7Nx9Q4Zh ik3CM/PwxPQttGC/hooMIc5R5h3YOffJ1Fdcr/4mAk7rz16ffiW7BM2Se7E8QtGGVtSB eanw== 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=glrhw50QSzQ/RdFzWmJtotbFgR/Gz5hv5whRIe4gxa4=; b=DMW+lSM5em5Jmv6GjSO5BLW04rb166NmzG7Bk3YS2l+b6sdDY+ffnWGJGm3O7c3WdV ErnxrKpnIaiB+uT8bDoqzbx7pX/gZhvvYX2nLDSjIqVlOPN3tng83mVUXo+/Cj0HMstj j0gtJ/NZ1cRPCMW7+YWW5z0vsqQI8r+d+uB7rvQ4qp3JQuuWc6UVMcuvDz+hPDNp6+xB nttVYY5TEGIJnYjO0Fx38cpztsOV2MTX2i04XKYgwqyRbe5KgW8jwRMh12NabkaBqrzV P19rsS8gU8aeJcrq79+W6/le1sAy7YkVG1zrV7R8OZQKrJKPz7AcBjGrQdmhu/b/lHHa OOig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T9MK0hrA; 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 l8si1435626edj.442.2020.09.11.08.05.01; Fri, 11 Sep 2020 08:05:25 -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=T9MK0hrA; 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 S1726289AbgIKPDn (ORCPT + 99 others); Fri, 11 Sep 2020 11:03:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:52804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbgIKNCU (ORCPT ); Fri, 11 Sep 2020 09:02:20 -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 5496D22283; Fri, 11 Sep 2020 12:56:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599829014; bh=MwxD5VJzHt3uN3NMF6cZstG6zJoHeJtlRavYi1XCW/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9MK0hrAkROjVzE/fPrKwb05qIZajrlrWbgPgTtNs6XUx9y9E3FIrXNLWpkbkEUf7 tq4wlLO2ATzWvhQQZNpwFtCELEpCI2O6RoPOj+3RNx5JCAhTqrlDEvrbEbQY3444l9 FnMWfE/3cvGq+Xfe44HmykfTII5nkzjEGQSUyAeE= 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.9 05/71] nvmet: Disable keep-alive timer when kato is cleared to 0h Date: Fri, 11 Sep 2020 14:45:49 +0200 Message-Id: <20200911122505.205904909@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200911122504.928931589@linuxfoundation.org> References: <20200911122504.928931589@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 96ea6c76be6e5..63b87a8472762 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -205,6 +205,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); @@ -214,6 +217,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