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

Keith Busch keith.busch at intel.com
Thu Apr 7 07:24:50 PDT 2016


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.



More information about the Linux-nvme mailing list