static int scsi_bus_suspend_common(struct device *dev, pm_message_t msg) { int err = 0; if (scsi_is_sdev_device(dev)) err = scsi_dev_type_suspend(dev, msg); return err; }
static int scsi_runtime_suspend(struct device *dev) { int err = 0; dev_dbg(dev, "scsi_runtime_suspend\n"); if (scsi_is_sdev_device(dev)) { err = scsi_dev_type_suspend(dev, PMSG_AUTO_SUSPEND); if (err == -EAGAIN) pm_schedule_suspend(dev, jiffies_to_msecs( round_jiffies_up_relative(HZ/10))); } return err; }
static int scsi_runtime_suspend(struct device *dev) { int err = 0; dev_dbg(dev, "scsi_runtime_suspend\n"); if (scsi_is_sdev_device(dev)) { err = scsi_dev_type_suspend(dev, PMSG_AUTO_SUSPEND); if (err == -EAGAIN) pm_schedule_suspend(dev, jiffies_to_msecs( round_jiffies_up_relative(HZ/10))); } /* Insert hooks here for targets, hosts, and transport classes */ return err; }
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 err; if (sdev->request_queue->dev) return sdev_blk_runtime_suspend(sdev, cb); err = scsi_dev_type_suspend(dev, cb); if (err == -EAGAIN) pm_schedule_suspend(dev, jiffies_to_msecs( round_jiffies_up_relative(HZ/10))); return err; }
static int scsi_bus_suspend_common(struct device *dev, pm_message_t msg) { int err = 0; if (scsi_is_sdev_device(dev)) { if (pm_runtime_suspended(dev)) { if (msg.event == PM_EVENT_SUSPEND || msg.event == PM_EVENT_HIBERNATE) return 0; pm_runtime_resume(dev); } err = scsi_dev_type_suspend(dev, msg); } return err; }
static int scsi_bus_suspend_common(struct device *dev, int (*cb)(struct device *)) { int err = 0; if (scsi_is_sdev_device(dev)) { /* * All the high-level SCSI drivers that implement runtime * PM treat runtime suspend, system suspend, and system * hibernate identically. */ if (pm_runtime_suspended(dev)) return 0; err = scsi_dev_type_suspend(dev, cb); } return err; }
static int scsi_bus_suspend_common(struct device *dev, int (*cb)(struct device *, const struct dev_pm_ops *)) { int err = 0; if (scsi_is_sdev_device(dev)) { /* * All the high-level SCSI drivers that implement runtime * PM treat runtime suspend, system suspend, and system * hibernate nearly identically. In all cases the requirements * for runtime suspension are stricter. */ if (pm_runtime_suspended(dev)) return 0; err = scsi_dev_type_suspend(dev, cb); } return err; }
static int scsi_bus_suspend_common(struct device *dev, pm_message_t msg) { int err = 0; if (scsi_is_sdev_device(dev)) { /* * sd is the only high-level SCSI driver to implement runtime * PM, and sd treats runtime suspend, system suspend, and * system hibernate identically (but not system freeze). */ if (pm_runtime_suspended(dev)) { if (msg.event == PM_EVENT_SUSPEND || msg.event == PM_EVENT_HIBERNATE) return 0; /* already suspended */ /* wake up device so that FREEZE will succeed */ pm_runtime_resume(dev); } err = scsi_dev_type_suspend(dev, msg); } return err; }