All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme-fc: flush err and connect work in .stop_ctrl
@ 2018-12-20 19:04 Sagi Grimberg
  2018-12-20 23:31 ` James Smart
  0 siblings, 1 reply; 3+ messages in thread
From: Sagi Grimberg @ 2018-12-20 19:04 UTC (permalink / raw)


Controller op .stop_ctrl was designed to let the driver
quiesce any pending works that may be active before starting
the controller teardown (delete_ctrl).

Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/fc.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 89accc76d71c..bf2ddc6850af 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2802,12 +2802,19 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl)
 }
 
 static void
-nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
+nvme_fc_stop_ctrl(struct nvme_ctrl *nctrl)
 {
 	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
 
 	cancel_work_sync(&ctrl->err_work);
 	cancel_delayed_work_sync(&ctrl->connect_work);
+}
+
+static void
+nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
+{
+	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
+
 	/*
 	 * kill the association on the link side.  this will block
 	 * waiting for io to terminate
@@ -2925,6 +2932,7 @@ static const struct nvme_ctrl_ops nvme_fc_ctrl_ops = {
 	.free_ctrl		= nvme_fc_nvme_ctrl_freed,
 	.submit_async_event	= nvme_fc_submit_async_event,
 	.delete_ctrl		= nvme_fc_delete_ctrl,
+	.stop_ctrl		= nvme_fc_stop_ctrl,
 	.get_address		= nvmf_get_address,
 };
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] nvme-fc: flush err and connect work in .stop_ctrl
  2018-12-20 19:04 [PATCH] nvme-fc: flush err and connect work in .stop_ctrl Sagi Grimberg
@ 2018-12-20 23:31 ` James Smart
  2018-12-21  2:14   ` Sagi Grimberg
  0 siblings, 1 reply; 3+ messages in thread
From: James Smart @ 2018-12-20 23:31 UTC (permalink / raw)




On 12/20/2018 11:04 AM, Sagi Grimberg wrote:
> Controller op .stop_ctrl was designed to let the driver
> quiesce any pending works that may be active before starting
> the controller teardown (delete_ctrl).
>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
>   drivers/nvme/host/fc.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index 89accc76d71c..bf2ddc6850af 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -2802,12 +2802,19 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl)
>   }
>   
>   static void
> -nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
> +nvme_fc_stop_ctrl(struct nvme_ctrl *nctrl)
>   {
>   	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
>   
>   	cancel_work_sync(&ctrl->err_work);
>   	cancel_delayed_work_sync(&ctrl->connect_work);
> +}
> +
> +static void
> +nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl)
> +{
> +	struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl);
> +
>   	/*
>   	 * kill the association on the link side.  this will block
>   	 * waiting for io to terminate
> @@ -2925,6 +2932,7 @@ static const struct nvme_ctrl_ops nvme_fc_ctrl_ops = {
>   	.free_ctrl		= nvme_fc_nvme_ctrl_freed,
>   	.submit_async_event	= nvme_fc_submit_async_event,
>   	.delete_ctrl		= nvme_fc_delete_ctrl,
> +	.stop_ctrl		= nvme_fc_stop_ctrl,
>   	.get_address		= nvmf_get_address,
>   };
>   

Hmm... I don't remember it being described that way when it was added 
and when I looked at it then, I had no need for the entrypoint. if all 
it does is cancel err_work and connect_work, I'm still wondering what it 
really does/achieves. Killing them off seems weird.

I'll take a closer look at where things sit now.

-- james

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] nvme-fc: flush err and connect work in .stop_ctrl
  2018-12-20 23:31 ` James Smart
@ 2018-12-21  2:14   ` Sagi Grimberg
  0 siblings, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2018-12-21  2:14 UTC (permalink / raw)



> Hmm... I don't remember it being described that way when it was added 
> and when I looked at it then, I had no need for the entrypoint. if all 
> it does is cancel err_work and connect_work, I'm still wondering what it 
> really does/achieves. Killing them off seems weird.
> 
> I'll take a closer look at where things sit now.

I'm fine with killing those as well.

In fact, if we move err_work and connect_work to nvme_ctrl
we can simply have nvme_stop_ctrl flush them... However Christoph
asked for a more generic use of these members/routines for that
to happen...

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-21  2:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 19:04 [PATCH] nvme-fc: flush err and connect work in .stop_ctrl Sagi Grimberg
2018-12-20 23:31 ` James Smart
2018-12-21  2:14   ` Sagi Grimberg

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.