[PATCH] Avoid reset work on watchdog timer function during error recovery

Guilherme G. Piccoli gpiccoli at linux.vnet.ibm.com
Thu Apr 7 08:42:29 PDT 2016



On 04/07/2016 11:24 AM, Keith Busch wrote:
> On Thu, Apr 07, 2016 at 06:11:31AM -0700, Christoph Hellwig wrote:
>> static bool nvme_should_reset(struct nvme_dev *dev)
>> {
>> 	u32 csts = readl(dev->bar + NVME_REG_CSTS);
>>
>> 	if (!(csts & NVME_CSTS_CFS) &&
>> 	    !((dev->subsystem && (csts & NVME_CSTS_NSSRO))))
>> 		return false;
>>
>> 	if (work_pending(&dev->reset_work))
>> 		return false;
>> 	if (work_busy(&dev->reset_work))
>> 		return false;
>
> We could also skip checking work_pending since work_busy does that for us.
>

Great! What name should/can I choose for the function?

Thanks,


Guilherme




More information about the Linux-nvme mailing list