All of lore.kernel.org
 help / color / mirror / Atom feed
From: james.smart@broadcom.com (James Smart)
Subject: [PATCH 2/2] nvme: start keep alive timer when enabling the controller
Date: Mon, 16 Apr 2018 09:45:13 -0700	[thread overview]
Message-ID: <5d1409bb-1f76-432f-6e0b-d36a616c2682@broadcom.com> (raw)
In-Reply-To: <20180415084741.4235-2-sagi@grimberg.me>

On 4/15/2018 1:47 AM, Sagi Grimberg wrote:
> From: Max Gurtuvoy <maxg at mellanox.com>
>
> We start the keep alive timer after all the I/O queues were
> created, this might be too late as the controller might have
> start its keep alive timer when it was enabled. Hence, start
> it right after controller enable was completed.
>
> We stop the keep alive in nvme_stop_ctrl as its before the
> disable/shutdown and its independent of the transport connectivity.
>
> Suggested-by: Max Gurtuvoy <maxg at mellanox.com>
> Suggested-by: James Smart <james.smart at broadcom.com>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
>   drivers/nvme/host/core.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e1b708ee6783..4b5c3f7addeb 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1739,7 +1739,14 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl, u64 cap)
>   	ret = ctrl->ops->reg_write32(ctrl, NVME_REG_CC, ctrl->ctrl_config);
>   	if (ret)
>   		return ret;
> -	return nvme_wait_ready(ctrl, cap, true);
> +
> +	ret = nvme_wait_ready(ctrl, cap, true);
> +	if (ret)
> +		return ret;
> +
> +	nvme_start_keep_alive(ctrl);
> +
> +	return 0;
>   }
>   EXPORT_SYMBOL_GPL(nvme_enable_ctrl);
>   
> @@ -3393,9 +3400,6 @@ EXPORT_SYMBOL_GPL(nvme_stop_ctrl);
>   
>   void nvme_start_ctrl(struct nvme_ctrl *ctrl)
>   {
> -	if (ctrl->kato)
> -		nvme_start_keep_alive(ctrl);
> -
>   	if (ctrl->queue_count > 1) {
>   		nvme_queue_scan(ctrl);
>   		queue_work(nvme_wq, &ctrl->async_event_work);


Signed-off-by:? James Smart <james.smart at broadcom.com>

  parent reply	other threads:[~2018-04-16 16:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-15  8:47 [PATCH 1/2] nvmet: reset keep alive timer in controller enable Sagi Grimberg
2018-04-15  8:47 ` [PATCH 2/2] nvme: start keep alive timer when enabling the controller Sagi Grimberg
2018-04-15  9:23   ` Max Gurtovoy
2018-04-15 10:17     ` Sagi Grimberg
2018-04-17 15:24       ` Christoph Hellwig
2018-04-23 10:08         ` Max Gurtovoy
2018-04-29 12:11           ` [Suspected-Phishing]Re: " Max Gurtovoy
2018-06-17 10:26         ` Max Gurtovoy
2018-06-19  5:42           ` Christoph Hellwig
2018-04-16 16:45   ` James Smart [this message]
2018-04-16 16:45 ` [PATCH 1/2] nvmet: reset keep alive timer in controller enable James Smart
2018-04-17 15:24 ` Christoph Hellwig
2018-04-22 14:26   ` Max Gurtovoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d1409bb-1f76-432f-6e0b-d36a616c2682@broadcom.com \
    --to=james.smart@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.