Lines Matching +full:pm +full:- +full:bus
1 // SPDX-License-Identifier: GPL-2.0
3 * drivers/base/power/main.c - Where the driver meets power management.
10 * and add it to the list of power-controlled devices. sysfs entries for
18 #define pr_fmt(fmt) "PM: " fmt
24 #include <linux/pm.h>
26 #include <linux/pm-trace.h>
89 return "(unknown PM event)"; in pm_verb()
94 * device_pm_sleep_init - Initialize system suspend-related device fields.
99 dev->power.is_prepared = false; in device_pm_sleep_init()
100 dev->power.is_suspended = false; in device_pm_sleep_init()
101 dev->power.is_noirq_suspended = false; in device_pm_sleep_init()
102 dev->power.is_late_suspended = false; in device_pm_sleep_init()
103 init_completion(&dev->power.completion); in device_pm_sleep_init()
104 complete_all(&dev->power.completion); in device_pm_sleep_init()
105 dev->power.wakeup = NULL; in device_pm_sleep_init()
106 INIT_LIST_HEAD(&dev->power.entry); in device_pm_sleep_init()
110 * device_pm_lock - Lock the list of active devices used by the PM core.
118 * device_pm_unlock - Unlock the list of active devices used by the PM core.
126 * device_pm_add - Add a device to the PM core's list of active devices.
131 /* Skip PM setup/initialization. */ in device_pm_add()
136 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); in device_pm_add()
139 if (dev->parent && dev->parent->power.is_prepared) in device_pm_add()
141 dev_name(dev->parent)); in device_pm_add()
142 list_add_tail(&dev->power.entry, &dpm_list); in device_pm_add()
143 dev->power.in_dpm_list = true; in device_pm_add()
148 * device_pm_remove - Remove a device from the PM core's list of active devices.
157 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); in device_pm_remove()
158 complete_all(&dev->power.completion); in device_pm_remove()
160 list_del_init(&dev->power.entry); in device_pm_remove()
161 dev->power.in_dpm_list = false; in device_pm_remove()
169 * device_pm_move_before - Move device in the PM core's list of active devices.
176 deva->bus ? deva->bus->name : "No Bus", dev_name(deva), in device_pm_move_before()
177 devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); in device_pm_move_before()
179 list_move_tail(&deva->power.entry, &devb->power.entry); in device_pm_move_before()
183 * device_pm_move_after - Move device in the PM core's list of active devices.
190 deva->bus ? deva->bus->name : "No Bus", dev_name(deva), in device_pm_move_after()
191 devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); in device_pm_move_after()
193 list_move(&deva->power.entry, &devb->power.entry); in device_pm_move_after()
197 * device_pm_move_last - Move device to end of the PM core's list of devices.
203 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); in device_pm_move_last()
204 list_move_tail(&dev->power.entry, &dpm_list); in device_pm_move_last()
214 dev->parent ? dev_name(dev->parent) : "none"); in initcall_debug_start()
232 * dpm_wait - Wait for a PM operation to complete.
241 if (async || (pm_async_enabled && dev->power.async_suspend)) in dpm_wait()
242 wait_for_completion(&dev->power.completion); in dpm_wait()
270 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) in dpm_wait_for_suppliers()
271 if (READ_ONCE(link->status) != DL_STATE_DORMANT) in dpm_wait_for_suppliers()
272 dpm_wait(link->supplier, async); in dpm_wait_for_suppliers()
295 parent = get_device(dev->parent); in dpm_wait_for_superior()
327 list_for_each_entry_rcu_locked(link, &dev->links.consumers, s_node) in dpm_wait_for_consumers()
328 if (READ_ONCE(link->status) != DL_STATE_DORMANT) in dpm_wait_for_consumers()
329 dpm_wait(link->consumer, async); in dpm_wait_for_consumers()
341 * pm_op - Return the PM operation appropriate for given PM event.
342 * @ops: PM operations to choose from.
343 * @state: PM transition of the system being carried out.
350 return ops->suspend; in pm_op()
352 return ops->resume; in pm_op()
357 return ops->freeze; in pm_op()
359 return ops->poweroff; in pm_op()
362 return ops->thaw; in pm_op()
364 return ops->restore; in pm_op()
372 * pm_late_early_op - Return the PM operation appropriate for given PM event.
373 * @ops: PM operations to choose from.
374 * @state: PM transition of the system being carried out.
376 * Runtime PM is disabled for @dev while this function is being executed.
384 return ops->suspend_late; in pm_late_early_op()
386 return ops->resume_early; in pm_late_early_op()
391 return ops->freeze_late; in pm_late_early_op()
393 return ops->poweroff_late; in pm_late_early_op()
396 return ops->thaw_early; in pm_late_early_op()
398 return ops->restore_early; in pm_late_early_op()
406 * pm_noirq_op - Return the PM operation appropriate for given PM event.
407 * @ops: PM operations to choose from.
408 * @state: PM transition of the system being carried out.
418 return ops->suspend_noirq; in pm_noirq_op()
420 return ops->resume_noirq; in pm_noirq_op()
425 return ops->freeze_noirq; in pm_noirq_op()
427 return ops->poweroff_noirq; in pm_noirq_op()
430 return ops->thaw_noirq; in pm_noirq_op()
432 return ops->restore_noirq; in pm_noirq_op()
443 ", may wakeup" : "", dev->power.driver_flags); in pm_dev_dbg()
506 * dpm_watchdog_handler - Driver suspend / resume watchdog handler.
507 * @t: The timer that PM watchdog depends on.
511 * capture a crash-dump in pstore.
517 dev_emerg(wd->dev, "**** DPM device timeout ****\n"); in dpm_watchdog_handler()
518 show_stack(wd->tsk, NULL, KERN_EMERG); in dpm_watchdog_handler()
520 dev_driver_string(wd->dev), dev_name(wd->dev)); in dpm_watchdog_handler()
524 * dpm_watchdog_set - Enable pm watchdog for given device.
530 struct timer_list *timer = &wd->timer; in dpm_watchdog_set()
532 wd->dev = dev; in dpm_watchdog_set()
533 wd->tsk = current; in dpm_watchdog_set()
537 timer->expires = jiffies + HZ * CONFIG_DPM_WATCHDOG_TIMEOUT; in dpm_watchdog_set()
542 * dpm_watchdog_clear - Disable suspend/resume watchdog.
547 struct timer_list *timer = &wd->timer; in dpm_watchdog_clear()
558 /*------------------------- Resume routines -------------------------*/
561 * dev_pm_skip_resume - System-wide device resume optimization check.
565 * - %false if the transition under way is RESTORE.
566 * - Return value of dev_pm_skip_suspend() if the transition under way is THAW.
567 * - The logical negation of %power.must_resume otherwise (that is, when the
578 return !dev->power.must_resume; in dev_pm_skip_resume()
582 * __device_resume_noirq - Execute a "noirq resume" callback for given device.
584 * @state: PM transition of the system being carried out.
600 if (dev->power.syscore || dev->power.direct_complete) in __device_resume_noirq()
603 if (!dev->power.is_noirq_suspended) in __device_resume_noirq()
613 * this device later, it needs to appear as "suspended" to PM-runtime, in __device_resume_noirq()
616 * Otherwise, the device is going to be resumed, so set its PM-runtime in __device_resume_noirq()
625 if (dev->pm_domain) { in __device_resume_noirq()
627 callback = pm_noirq_op(&dev->pm_domain->ops, state); in __device_resume_noirq()
628 } else if (dev->type && dev->type->pm) { in __device_resume_noirq()
630 callback = pm_noirq_op(dev->type->pm, state); in __device_resume_noirq()
631 } else if (dev->class && dev->class->pm) { in __device_resume_noirq()
633 callback = pm_noirq_op(dev->class->pm, state); in __device_resume_noirq()
634 } else if (dev->bus && dev->bus->pm) { in __device_resume_noirq()
635 info = "noirq bus "; in __device_resume_noirq()
636 callback = pm_noirq_op(dev->bus->pm, state); in __device_resume_noirq()
644 if (dev->driver && dev->driver->pm) { in __device_resume_noirq()
646 callback = pm_noirq_op(dev->driver->pm, state); in __device_resume_noirq()
653 dev->power.is_noirq_suspended = false; in __device_resume_noirq()
656 complete_all(&dev->power.completion); in __device_resume_noirq()
669 return dev->power.async_suspend && pm_async_enabled in is_async()
675 reinit_completion(&dev->power.completion); in dpm_async_fn()
718 list_move_tail(&dev->power.entry, &dpm_late_early_list); in dpm_noirq_resume_devices()
735 * dpm_resume_noirq - Execute "noirq resume" callbacks for all devices.
736 * @state: PM transition of the system being carried out.
750 * __device_resume_early - Execute an "early resume" callback for given device.
752 * @state: PM transition of the system being carried out.
755 * Runtime PM is disabled for @dev while this function is being executed.
766 if (dev->power.syscore || dev->power.direct_complete) in __device_resume_early()
769 if (!dev->power.is_late_suspended) in __device_resume_early()
775 if (dev->pm_domain) { in __device_resume_early()
777 callback = pm_late_early_op(&dev->pm_domain->ops, state); in __device_resume_early()
778 } else if (dev->type && dev->type->pm) { in __device_resume_early()
780 callback = pm_late_early_op(dev->type->pm, state); in __device_resume_early()
781 } else if (dev->class && dev->class->pm) { in __device_resume_early()
783 callback = pm_late_early_op(dev->class->pm, state); in __device_resume_early()
784 } else if (dev->bus && dev->bus->pm) { in __device_resume_early()
785 info = "early bus "; in __device_resume_early()
786 callback = pm_late_early_op(dev->bus->pm, state); in __device_resume_early()
794 if (dev->driver && dev->driver->pm) { in __device_resume_early()
796 callback = pm_late_early_op(dev->driver->pm, state); in __device_resume_early()
803 dev->power.is_late_suspended = false; in __device_resume_early()
809 complete_all(&dev->power.completion); in __device_resume_early()
836 * dpm_resume_early - Execute "early resume" callbacks for all devices.
837 * @state: PM transition of the system being carried out.
851 list_move_tail(&dev->power.entry, &dpm_suspended_list); in dpm_resume_early()
868 * dpm_resume_start - Execute "noirq" and "early" device callbacks.
869 * @state: PM transition of the system being carried out.
879 * __device_resume - Execute "resume" callbacks for given device.
881 * @state: PM transition of the system being carried out.
894 if (dev->power.syscore) in __device_resume()
897 if (dev->power.direct_complete) { in __device_resume()
913 dev->power.is_prepared = false; in __device_resume()
915 if (!dev->power.is_suspended) in __device_resume()
918 if (dev->pm_domain) { in __device_resume()
920 callback = pm_op(&dev->pm_domain->ops, state); in __device_resume()
924 if (dev->type && dev->type->pm) { in __device_resume()
926 callback = pm_op(dev->type->pm, state); in __device_resume()
930 if (dev->class && dev->class->pm) { in __device_resume()
932 callback = pm_op(dev->class->pm, state); in __device_resume()
936 if (dev->bus) { in __device_resume()
937 if (dev->bus->pm) { in __device_resume()
938 info = "bus "; in __device_resume()
939 callback = pm_op(dev->bus->pm, state); in __device_resume()
940 } else if (dev->bus->resume) { in __device_resume()
941 info = "legacy bus "; in __device_resume()
942 callback = dev->bus->resume; in __device_resume()
948 if (!callback && dev->driver && dev->driver->pm) { in __device_resume()
950 callback = pm_op(dev->driver->pm, state); in __device_resume()
955 dev->power.is_suspended = false; in __device_resume()
962 complete_all(&dev->power.completion); in __device_resume()
991 * dpm_resume - Execute "resume" callbacks for non-sysdev devices.
992 * @state: PM transition of the system being carried out.
1020 if (!list_empty(&dev->power.entry)) in dpm_resume()
1021 list_move_tail(&dev->power.entry, &dpm_prepared_list); in dpm_resume()
1039 * device_complete - Complete a PM transition for given device.
1041 * @state: PM transition of the system being carried out.
1048 if (dev->power.syscore) in device_complete()
1053 if (dev->pm_domain) { in device_complete()
1055 callback = dev->pm_domain->ops.complete; in device_complete()
1056 } else if (dev->type && dev->type->pm) { in device_complete()
1058 callback = dev->type->pm->complete; in device_complete()
1059 } else if (dev->class && dev->class->pm) { in device_complete()
1061 callback = dev->class->pm->complete; in device_complete()
1062 } else if (dev->bus && dev->bus->pm) { in device_complete()
1063 info = "completing bus "; in device_complete()
1064 callback = dev->bus->pm->complete; in device_complete()
1067 if (!callback && dev->driver && dev->driver->pm) { in device_complete()
1069 callback = dev->driver->pm->complete; in device_complete()
1084 * dpm_complete - Complete a PM transition for all non-sysdev devices.
1085 * @state: PM transition of the system being carried out.
1087 * Execute the ->complete() callbacks for all devices whose PM status is not
1103 dev->power.is_prepared = false; in dpm_complete()
1104 list_move(&dev->power.entry, &list); in dpm_complete()
1119 /* Allow device probing and trigger re-probing of deferred devices */ in dpm_complete()
1125 * dpm_resume_end - Execute "resume" callbacks and complete system transition.
1126 * @state: PM transition of the system being carried out.
1128 * Execute "resume" callbacks for all devices and complete the PM transition of
1139 /*------------------------- Suspend routines -------------------------*/
1142 * resume_event - Return a "resume" message for given "suspend" sleep state.
1143 * @sleep_state: PM message representing a sleep state.
1145 * Return a PM message representing the resume event corresponding to given
1167 if (dev->parent) in dpm_superior_set_must_resume()
1168 dev->parent->power.must_resume = true; in dpm_superior_set_must_resume()
1172 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) in dpm_superior_set_must_resume()
1173 link->supplier->power.must_resume = true; in dpm_superior_set_must_resume()
1179 * __device_suspend_noirq - Execute a "noirq suspend" callback for given device.
1181 * @state: PM transition of the system being carried out.
1201 if (dev->power.syscore || dev->power.direct_complete) in __device_suspend_noirq()
1204 if (dev->pm_domain) { in __device_suspend_noirq()
1206 callback = pm_noirq_op(&dev->pm_domain->ops, state); in __device_suspend_noirq()
1207 } else if (dev->type && dev->type->pm) { in __device_suspend_noirq()
1209 callback = pm_noirq_op(dev->type->pm, state); in __device_suspend_noirq()
1210 } else if (dev->class && dev->class->pm) { in __device_suspend_noirq()
1212 callback = pm_noirq_op(dev->class->pm, state); in __device_suspend_noirq()
1213 } else if (dev->bus && dev->bus->pm) { in __device_suspend_noirq()
1214 info = "noirq bus "; in __device_suspend_noirq()
1215 callback = pm_noirq_op(dev->bus->pm, state); in __device_suspend_noirq()
1223 if (dev->driver && dev->driver->pm) { in __device_suspend_noirq()
1225 callback = pm_noirq_op(dev->driver->pm, state); in __device_suspend_noirq()
1236 dev->power.is_noirq_suspended = true; in __device_suspend_noirq()
1240 * system suspend (as indicated by their PM-runtime usage counters) in __device_suspend_noirq()
1244 if (atomic_read(&dev->power.usage_count) > 1 || in __device_suspend_noirq()
1246 dev->power.may_skip_resume)) in __device_suspend_noirq()
1247 dev->power.must_resume = true; in __device_suspend_noirq()
1249 if (dev->power.must_resume) in __device_suspend_noirq()
1253 complete_all(&dev->power.completion); in __device_suspend_noirq()
1303 } else if (!list_empty(&dev->power.entry)) { in dpm_noirq_suspend_devices()
1304 list_move(&dev->power.entry, &dpm_noirq_list); in dpm_noirq_suspend_devices()
1331 * dpm_suspend_noirq - Execute "noirq suspend" callbacks for all devices.
1332 * @state: PM transition of the system being carried out.
1335 * "noirq" suspend callbacks for all non-sysdev devices.
1353 struct device *parent = dev->parent; in dpm_propagate_wakeup_to_parent()
1358 spin_lock_irq(&parent->power.lock); in dpm_propagate_wakeup_to_parent()
1360 if (device_wakeup_path(dev) && !parent->power.ignore_children) in dpm_propagate_wakeup_to_parent()
1361 parent->power.wakeup_path = true; in dpm_propagate_wakeup_to_parent()
1363 spin_unlock_irq(&parent->power.lock); in dpm_propagate_wakeup_to_parent()
1367 * __device_suspend_late - Execute a "late suspend" callback for given device.
1369 * @state: PM transition of the system being carried out.
1372 * Runtime PM is disabled for @dev while this function is being executed.
1391 async_error = -EBUSY; in __device_suspend_late()
1395 if (dev->power.syscore || dev->power.direct_complete) in __device_suspend_late()
1398 if (dev->pm_domain) { in __device_suspend_late()
1400 callback = pm_late_early_op(&dev->pm_domain->ops, state); in __device_suspend_late()
1401 } else if (dev->type && dev->type->pm) { in __device_suspend_late()
1403 callback = pm_late_early_op(dev->type->pm, state); in __device_suspend_late()
1404 } else if (dev->class && dev->class->pm) { in __device_suspend_late()
1406 callback = pm_late_early_op(dev->class->pm, state); in __device_suspend_late()
1407 } else if (dev->bus && dev->bus->pm) { in __device_suspend_late()
1408 info = "late bus "; in __device_suspend_late()
1409 callback = pm_late_early_op(dev->bus->pm, state); in __device_suspend_late()
1417 if (dev->driver && dev->driver->pm) { in __device_suspend_late()
1419 callback = pm_late_early_op(dev->driver->pm, state); in __device_suspend_late()
1431 dev->power.is_late_suspended = true; in __device_suspend_late()
1435 complete_all(&dev->power.completion); in __device_suspend_late()
1461 * dpm_suspend_late - Execute "late suspend" callbacks for all devices.
1462 * @state: PM transition of the system being carried out.
1486 if (!list_empty(&dev->power.entry)) in dpm_suspend_late()
1487 list_move(&dev->power.entry, &dpm_late_early_list); in dpm_suspend_late()
1518 * dpm_suspend_end - Execute "late" and "noirq" device suspend callbacks.
1519 * @state: PM transition of the system being carried out.
1541 * legacy_suspend - Execute a legacy (bus or class) suspend callback for device.
1543 * @state: PM transition of the system being carried out.
1571 if (dev->parent) { in dpm_clear_superiors_direct_complete()
1572 spin_lock_irq(&dev->parent->power.lock); in dpm_clear_superiors_direct_complete()
1573 dev->parent->power.direct_complete = false; in dpm_clear_superiors_direct_complete()
1574 spin_unlock_irq(&dev->parent->power.lock); in dpm_clear_superiors_direct_complete()
1579 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) { in dpm_clear_superiors_direct_complete()
1580 spin_lock_irq(&link->supplier->power.lock); in dpm_clear_superiors_direct_complete()
1581 link->supplier->power.direct_complete = false; in dpm_clear_superiors_direct_complete()
1582 spin_unlock_irq(&link->supplier->power.lock); in dpm_clear_superiors_direct_complete()
1589 * __device_suspend - Execute "suspend" callbacks for given device.
1591 * @state: PM transition of the system being carried out.
1607 dev->power.direct_complete = false; in __device_suspend()
1612 * Wait for possible runtime PM transitions of the device in progress in __device_suspend()
1614 * resume it before proceeding with invoking the system-wide suspend in __device_suspend()
1617 * If the system-wide suspend callbacks below change the configuration in __device_suspend()
1618 * of the device, they must disable runtime PM for it or otherwise in __device_suspend()
1619 * ensure that its runtime-resume callbacks will not be confused by that in __device_suspend()
1625 dev->power.direct_complete = false; in __device_suspend()
1626 async_error = -EBUSY; in __device_suspend()
1630 if (dev->power.syscore) in __device_suspend()
1635 dev->power.direct_complete = false; in __device_suspend()
1637 if (dev->power.direct_complete) { in __device_suspend()
1641 pm_dev_dbg(dev, state, "direct-complete "); in __device_suspend()
1647 dev->power.direct_complete = false; in __device_suspend()
1650 dev->power.may_skip_resume = true; in __device_suspend()
1651 dev->power.must_resume = !dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME); in __device_suspend()
1656 if (dev->pm_domain) { in __device_suspend()
1658 callback = pm_op(&dev->pm_domain->ops, state); in __device_suspend()
1662 if (dev->type && dev->type->pm) { in __device_suspend()
1664 callback = pm_op(dev->type->pm, state); in __device_suspend()
1668 if (dev->class && dev->class->pm) { in __device_suspend()
1670 callback = pm_op(dev->class->pm, state); in __device_suspend()
1674 if (dev->bus) { in __device_suspend()
1675 if (dev->bus->pm) { in __device_suspend()
1676 info = "bus "; in __device_suspend()
1677 callback = pm_op(dev->bus->pm, state); in __device_suspend()
1678 } else if (dev->bus->suspend) { in __device_suspend()
1679 pm_dev_dbg(dev, state, "legacy bus "); in __device_suspend()
1680 error = legacy_suspend(dev, state, dev->bus->suspend, in __device_suspend()
1681 "legacy bus "); in __device_suspend()
1687 if (!callback && dev->driver && dev->driver->pm) { in __device_suspend()
1689 callback = pm_op(dev->driver->pm, state); in __device_suspend()
1696 dev->power.is_suspended = true; in __device_suspend()
1698 dev->power.wakeup_path = true; in __device_suspend()
1711 complete_all(&dev->power.completion); in __device_suspend()
1739 * dpm_suspend - Execute "suspend" callbacks for all non-sysdev devices.
1740 * @state: PM transition of the system being carried out.
1770 } else if (!list_empty(&dev->power.entry)) { in dpm_suspend()
1771 list_move(&dev->power.entry, &dpm_suspended_list); in dpm_suspend()
1797 * device_prepare - Prepare a device for system power transition.
1799 * @state: PM transition of the system being carried out.
1801 * Execute the ->prepare() callback(s) for given device. No new children of the
1817 if (dev->power.syscore) in device_prepare()
1822 dev->power.wakeup_path = false; in device_prepare()
1824 if (dev->power.no_pm_callbacks) in device_prepare()
1827 if (dev->pm_domain) in device_prepare()
1828 callback = dev->pm_domain->ops.prepare; in device_prepare()
1829 else if (dev->type && dev->type->pm) in device_prepare()
1830 callback = dev->type->pm->prepare; in device_prepare()
1831 else if (dev->class && dev->class->pm) in device_prepare()
1832 callback = dev->class->pm->prepare; in device_prepare()
1833 else if (dev->bus && dev->bus->pm) in device_prepare()
1834 callback = dev->bus->pm->prepare; in device_prepare()
1836 if (!callback && dev->driver && dev->driver->pm) in device_prepare()
1837 callback = dev->driver->pm->prepare; in device_prepare()
1851 * A positive return value from ->prepare() means "this device appears in device_prepare()
1852 * to be runtime-suspended and its state is fine, so if it really is in device_prepare()
1853 * runtime-suspended, you can leave it in that state provided that you in device_prepare()
1857 spin_lock_irq(&dev->power.lock); in device_prepare()
1858 dev->power.direct_complete = state.event == PM_EVENT_SUSPEND && in device_prepare()
1859 (ret > 0 || dev->power.no_pm_callbacks) && in device_prepare()
1861 spin_unlock_irq(&dev->power.lock); in device_prepare()
1866 * dpm_prepare - Prepare all non-sysdev devices for a system PM transition.
1867 * @state: PM transition of the system being carried out.
1869 * Execute the ->prepare() callback(s) for all devices.
1907 dev->power.is_prepared = true; in dpm_prepare()
1908 if (!list_empty(&dev->power.entry)) in dpm_prepare()
1909 list_move_tail(&dev->power.entry, &dpm_prepared_list); in dpm_prepare()
1910 } else if (error == -EAGAIN) { in dpm_prepare()
1929 * dpm_suspend_start - Prepare devices for PM transition and suspend them.
1930 * @state: PM transition of the system being carried out.
1932 * Prepare all non-sysdev devices for system PM transition and execute "suspend"
1959 * device_pm_wait_for_dev - Wait for suspend/resume of a device to complete.
1965 dpm_wait(dev, subordinate->power.async_suspend); in device_pm_wait_for_dev()
1971 * dpm_for_each_dev - device iterator.
1997 return !ops->prepare && in pm_ops_is_empty()
1998 !ops->suspend && in pm_ops_is_empty()
1999 !ops->suspend_late && in pm_ops_is_empty()
2000 !ops->suspend_noirq && in pm_ops_is_empty()
2001 !ops->resume_noirq && in pm_ops_is_empty()
2002 !ops->resume_early && in pm_ops_is_empty()
2003 !ops->resume && in pm_ops_is_empty()
2004 !ops->complete; in pm_ops_is_empty()
2011 spin_lock_irqsave(&dev->power.lock, flags); in device_pm_check_callbacks()
2012 dev->power.no_pm_callbacks = in device_pm_check_callbacks()
2013 (!dev->bus || (pm_ops_is_empty(dev->bus->pm) && in device_pm_check_callbacks()
2014 !dev->bus->suspend && !dev->bus->resume)) && in device_pm_check_callbacks()
2015 (!dev->class || pm_ops_is_empty(dev->class->pm)) && in device_pm_check_callbacks()
2016 (!dev->type || pm_ops_is_empty(dev->type->pm)) && in device_pm_check_callbacks()
2017 (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) && in device_pm_check_callbacks()
2018 (!dev->driver || (pm_ops_is_empty(dev->driver->pm) && in device_pm_check_callbacks()
2019 !dev->driver->suspend && !dev->driver->resume)); in device_pm_check_callbacks()
2020 spin_unlock_irqrestore(&dev->power.lock, flags); in device_pm_check_callbacks()