All of lore.kernel.org
 help / color / mirror / Atom feed
From: maxg@mellanox.com (Max Gurtovoy)
Subject: [PATCH 2/2] nvme: start keep alive timer when enabling the controller
Date: Sun, 15 Apr 2018 12:23:32 +0300	[thread overview]
Message-ID: <fe43038e-001c-7468-be66-3df96d9d95e0@mellanox.com> (raw)
In-Reply-To: <20180415084741.4235-2-sagi@grimberg.me>



On 4/15/2018 11: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.
> 

Christoph suggested to add the keep-alive stop to the disable/shutdown 
(I guess we need to add it to both, right ?) and in the target side to 
start expecting also once ctrl is enabled and stop when disabled.

Would you like me to send another version ? This one should also change 
the FC code since there is no use in nvme_disable_ctrl...


> 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);
> 

  reply	other threads:[~2018-04-15  9:23 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 [this message]
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
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=fe43038e-001c-7468-be66-3df96d9d95e0@mellanox.com \
    --to=maxg@mellanox.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.