Re: [PATCHv2 5/6] nvme: Prevent resets during paused states

Keith Busch
2019-09-28T00:24:02Z

On Fri, Sep 27, 2019 at 11:41:21PM +0200, Christoph Hellwig wrote:
> On Fri, Sep 20, 2019 at 06:34:30AM +0900, kbusch@kernel.org wrote:
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index 95b74d020506..33b5729763c2 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -3742,15 +3742,14 @@ static void nvme_fw_act_work(struct work_struct *work)
> > if (time_after(jiffies, fw_act_timeout)) {
> > dev_warn(ctrl->device,
> > "Fw activation timeout, reset controller\n");
> > - nvme_reset_ctrl(ctrl);
> > - break;
> > + nvme_reset_continue(ctrl);
> > + return;
>
> Hmm, I find the use of a function named nvme_reset_continue here
> rather confusing, as there is no reset we are continuing. Yes, we place
> the controller in resetting state, but it isn't really a reset in the

A PAUSED state would have to copy the same transitions that RESETTING has. It
seems simpler to just collapse this with the existing RESETTING state, and we
also don't need a special way to schedule reset_work from it.