Re: [PATCH v9 4/4] sd: change to auto suspend mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 18 Feb 2013, Aaron Lu wrote:

> Placing a WARN_ON there seems to suggest drivers should not return
> -EAGAIN, so I think I'll just add back those dropped code to
> sdev_runtime_suspend as you have suggested like this:
> 
> static int sdev_runtime_suspend(struct device *dev)
> {
> 	const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> 	int (*cb)(struct device *) = pm ? pm->runtime_suspend : NULL;
> 	struct scsi_device *sdev = to_scsi_device(dev);
> 	int ret;
> 
> 	if (sdev->request_queue->dev)
> 		return sdev_blk_runtime_suspend(sdev, cb);
> 
> 	ret = scsi_dev_type_suspend(dev, cb);
> 	if (ret == -EAGAIN)
> 		pm_schedule_suspend(dev, jiffies_to_msecs(
> 					round_jiffies_up_relative(HZ/10)));
> 	return ret;
> }
> 
> Does this look OK?

Yes.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux