[PATCH for-4.12] nvme/pci: Fix stuck nvme reset

Jens Axboe axboe at kernel.dk
Tue Jun 27 16:42:38 PDT 2017


On 06/27/2017 05:40 PM, Christoph Hellwig wrote:
> On Tue, Jun 27, 2017 at 07:43:38PM -0400, Keith Busch wrote:
>> The controller state is set to resetting prior to disabling the
>> controller, so this patch accounts for that state when deciding if it
>> needs to freeze the queues. Without this, an 'nvme reset /dev/nvme0'
>> blocks forever because the queues were never frozen.
> 
> Ouch.
> 
>> -		if (dev->ctrl.state == NVME_CTRL_LIVE)
>> +		if (dev->ctrl.state == NVME_CTRL_LIVE ||
>> +				dev->ctrl.state == NVME_CTRL_RESETTING)
> 
> Can you align this a little nicer:
> 
> 		if (dev->ctrl.state == NVME_CTRL_LIVE ||
> 		    dev->ctrl.state == NVME_CTRL_RESETTING)
> 
> Otherwise this looks fine:
> 
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> 
> Maybe Jens should pick this up directly for the block tree?  No
> point in a nvme pull request just for this.

Looks good to me too. As it so happens, I just hit this today, but didn't
have time to look into why. I'll add it for this series.

-- 
Jens Axboe




More information about the Linux-nvme mailing list