Re: [PATCHv2 4/6] nvme: Introduce nvme_reset_continue

Sagi Grimberg
2019-09-20T18:16:09Z

> ---
> drivers/nvme/host/core.c | 12 ++++++++++--
> drivers/nvme/host/nvme.h | 1 +
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e03b1765fc01..95b74d020506 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -117,14 +117,22 @@ static void nvme_queue_scan(struct nvme_ctrl *ctrl)
> queue_work(nvme_wq, &ctrl->scan_work);
> }
>
> -int nvme_reset_ctrl(struct nvme_ctrl *ctrl)
> +int nvme_reset_continue(struct nvme_ctrl *ctrl)
> {
> - if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_RESETTING))
> + if (ctrl->state != NVME_CTRL_RESETTING)
> return -EBUSY;
> if (!queue_work(nvme_reset_wq, &ctrl->reset_work))
> return -EBUSY;
> return 0;
> }
> +EXPORT_SYMBOL_GPL(nvme_reset_continue);

Would it be useful for you to have nvme_reset_continue_sync variant?