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()
663 return dev->power.async_suspend && pm_async_enabled in is_async()
669 reinit_completion(&dev->power.completion); in dpm_async_fn()
704 * delayed by non-async resuming devices. in dpm_noirq_resume_devices()
712 list_move_tail(&dev->power.entry, &dpm_late_early_list); in dpm_noirq_resume_devices()
739 * dpm_resume_noirq - Execute "noirq resume" callbacks for all devices.
740 * @state: PM transition of the system being carried out.
754 * device_resume_early - Execute an "early resume" callback for given device.
756 * @state: PM transition of the system being carried out.
759 * Runtime PM is disabled for @dev while this function is being executed.
770 if (dev->power.syscore || dev->power.direct_complete) in device_resume_early()
773 if (!dev->power.is_late_suspended) in device_resume_early()
779 if (dev->pm_domain) { in device_resume_early()
781 callback = pm_late_early_op(&dev->pm_domain->ops, state); in device_resume_early()
782 } else if (dev->type && dev->type->pm) { in device_resume_early()
784 callback = pm_late_early_op(dev->type->pm, state); in device_resume_early()
785 } else if (dev->class && dev->class->pm) { in device_resume_early()
787 callback = pm_late_early_op(dev->class->pm, state); in device_resume_early()
788 } else if (dev->bus && dev->bus->pm) { in device_resume_early()
789 info = "early bus "; in device_resume_early()
790 callback = pm_late_early_op(dev->bus->pm, state); in device_resume_early()
798 if (dev->driver && dev->driver->pm) { in device_resume_early()
800 callback = pm_late_early_op(dev->driver->pm, state); in device_resume_early()
807 dev->power.is_late_suspended = false; in device_resume_early()
813 complete_all(&dev->power.completion); in device_resume_early()
830 * dpm_resume_early - Execute "early resume" callbacks for all devices.
831 * @state: PM transition of the system being carried out.
845 * delayed by non-async resuming devices. in dpm_resume_early()
853 list_move_tail(&dev->power.entry, &dpm_suspended_list); in dpm_resume_early()
880 * dpm_resume_start - Execute "noirq" and "early" device callbacks.
881 * @state: PM transition of the system being carried out.
891 * device_resume - Execute "resume" callbacks for given device.
893 * @state: PM transition of the system being carried out.
906 if (dev->power.syscore) in device_resume()
909 if (dev->power.direct_complete) { in device_resume()
925 dev->power.is_prepared = false; in device_resume()
927 if (!dev->power.is_suspended) in device_resume()
930 if (dev->pm_domain) { in device_resume()
932 callback = pm_op(&dev->pm_domain->ops, state); in device_resume()
936 if (dev->type && dev->type->pm) { in device_resume()
938 callback = pm_op(dev->type->pm, state); in device_resume()
942 if (dev->class && dev->class->pm) { in device_resume()
944 callback = pm_op(dev->class->pm, state); in device_resume()
948 if (dev->bus) { in device_resume()
949 if (dev->bus->pm) { in device_resume()
950 info = "bus "; in device_resume()
951 callback = pm_op(dev->bus->pm, state); in device_resume()
952 } else if (dev->bus->resume) { in device_resume()
953 info = "legacy bus "; in device_resume()
954 callback = dev->bus->resume; in device_resume()
960 if (!callback && dev->driver && dev->driver->pm) { in device_resume()
962 callback = pm_op(dev->driver->pm, state); in device_resume()
967 dev->power.is_suspended = false; in device_resume()
974 complete_all(&dev->power.completion); in device_resume()
993 * dpm_resume - Execute "resume" callbacks for non-sysdev devices.
994 * @state: PM transition of the system being carried out.
1032 if (!list_empty(&dev->power.entry)) in dpm_resume()
1033 list_move_tail(&dev->power.entry, &dpm_prepared_list); in dpm_resume()
1051 * device_complete - Complete a PM transition for given device.
1053 * @state: PM transition of the system being carried out.
1060 if (dev->power.syscore) in device_complete()
1065 if (dev->pm_domain) { in device_complete()
1067 callback = dev->pm_domain->ops.complete; in device_complete()
1068 } else if (dev->type && dev->type->pm) { in device_complete()
1070 callback = dev->type->pm->complete; in device_complete()
1071 } else if (dev->class && dev->class->pm) { in device_complete()
1073 callback = dev->class->pm->complete; in device_complete()
1074 } else if (dev->bus && dev->bus->pm) { in device_complete()
1075 info = "completing bus "; in device_complete()
1076 callback = dev->bus->pm->complete; in device_complete()
1079 if (!callback && dev->driver && dev->driver->pm) { in device_complete()
1081 callback = dev->driver->pm->complete; in device_complete()
1096 * dpm_complete - Complete a PM transition for all non-sysdev devices.
1097 * @state: PM transition of the system being carried out.
1099 * Execute the ->complete() callbacks for all devices whose PM status is not
1115 dev->power.is_prepared = false; in dpm_complete()
1116 list_move(&dev->power.entry, &list); in dpm_complete()
1131 /* Allow device probing and trigger re-probing of deferred devices */ in dpm_complete()
1137 * dpm_resume_end - Execute "resume" callbacks and complete system transition.
1138 * @state: PM transition of the system being carried out.
1140 * Execute "resume" callbacks for all devices and complete the PM transition of
1151 /*------------------------- Suspend routines -------------------------*/
1154 * resume_event - Return a "resume" message for given "suspend" sleep state.
1155 * @sleep_state: PM message representing a sleep state.
1157 * Return a PM message representing the resume event corresponding to given
1179 if (dev->parent) in dpm_superior_set_must_resume()
1180 dev->parent->power.must_resume = true; in dpm_superior_set_must_resume()
1184 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) in dpm_superior_set_must_resume()
1185 link->supplier->power.must_resume = true; in dpm_superior_set_must_resume()
1191 * __device_suspend_noirq - Execute a "noirq suspend" callback for given device.
1193 * @state: PM transition of the system being carried out.
1213 if (dev->power.syscore || dev->power.direct_complete) in __device_suspend_noirq()
1216 if (dev->pm_domain) { in __device_suspend_noirq()
1218 callback = pm_noirq_op(&dev->pm_domain->ops, state); in __device_suspend_noirq()
1219 } else if (dev->type && dev->type->pm) { in __device_suspend_noirq()
1221 callback = pm_noirq_op(dev->type->pm, state); in __device_suspend_noirq()
1222 } else if (dev->class && dev->class->pm) { in __device_suspend_noirq()
1224 callback = pm_noirq_op(dev->class->pm, state); in __device_suspend_noirq()
1225 } else if (dev->bus && dev->bus->pm) { in __device_suspend_noirq()
1226 info = "noirq bus "; in __device_suspend_noirq()
1227 callback = pm_noirq_op(dev->bus->pm, state); in __device_suspend_noirq()
1235 if (dev->driver && dev->driver->pm) { in __device_suspend_noirq()
1237 callback = pm_noirq_op(dev->driver->pm, state); in __device_suspend_noirq()
1248 dev->power.is_noirq_suspended = true; in __device_suspend_noirq()
1252 * system suspend (as indicated by their PM-runtime usage counters) in __device_suspend_noirq()
1256 if (atomic_read(&dev->power.usage_count) > 1 || in __device_suspend_noirq()
1258 dev->power.may_skip_resume)) in __device_suspend_noirq()
1259 dev->power.must_resume = true; in __device_suspend_noirq()
1261 if (dev->power.must_resume) in __device_suspend_noirq()
1265 complete_all(&dev->power.completion); in __device_suspend_noirq()
1315 } else if (!list_empty(&dev->power.entry)) { in dpm_noirq_suspend_devices()
1316 list_move(&dev->power.entry, &dpm_noirq_list); in dpm_noirq_suspend_devices()
1343 * dpm_suspend_noirq - Execute "noirq suspend" callbacks for all devices.
1344 * @state: PM transition of the system being carried out.
1347 * "noirq" suspend callbacks for all non-sysdev devices.
1365 struct device *parent = dev->parent; in dpm_propagate_wakeup_to_parent()
1370 spin_lock_irq(&parent->power.lock); in dpm_propagate_wakeup_to_parent()
1372 if (device_wakeup_path(dev) && !parent->power.ignore_children) in dpm_propagate_wakeup_to_parent()
1373 parent->power.wakeup_path = true; in dpm_propagate_wakeup_to_parent()
1375 spin_unlock_irq(&parent->power.lock); in dpm_propagate_wakeup_to_parent()
1379 * __device_suspend_late - Execute a "late suspend" callback for given device.
1381 * @state: PM transition of the system being carried out.
1384 * Runtime PM is disabled for @dev while this function is being executed.
1403 async_error = -EBUSY; in __device_suspend_late()
1407 if (dev->power.syscore || dev->power.direct_complete) in __device_suspend_late()
1410 if (dev->pm_domain) { in __device_suspend_late()
1412 callback = pm_late_early_op(&dev->pm_domain->ops, state); in __device_suspend_late()
1413 } else if (dev->type && dev->type->pm) { in __device_suspend_late()
1415 callback = pm_late_early_op(dev->type->pm, state); in __device_suspend_late()
1416 } else if (dev->class && dev->class->pm) { in __device_suspend_late()
1418 callback = pm_late_early_op(dev->class->pm, state); in __device_suspend_late()
1419 } else if (dev->bus && dev->bus->pm) { in __device_suspend_late()
1420 info = "late bus "; in __device_suspend_late()
1421 callback = pm_late_early_op(dev->bus->pm, state); in __device_suspend_late()
1429 if (dev->driver && dev->driver->pm) { in __device_suspend_late()
1431 callback = pm_late_early_op(dev->driver->pm, state); in __device_suspend_late()
1443 dev->power.is_late_suspended = true; in __device_suspend_late()
1447 complete_all(&dev->power.completion); in __device_suspend_late()
1473 * dpm_suspend_late - Execute "late suspend" callbacks for all devices.
1474 * @state: PM transition of the system being carried out.
1498 if (!list_empty(&dev->power.entry)) in dpm_suspend_late()
1499 list_move(&dev->power.entry, &dpm_late_early_list); in dpm_suspend_late()
1530 * dpm_suspend_end - Execute "late" and "noirq" device suspend callbacks.
1531 * @state: PM transition of the system being carried out.
1553 * legacy_suspend - Execute a legacy (bus or class) suspend callback for device.
1555 * @state: PM transition of the system being carried out.
1583 if (dev->parent) { in dpm_clear_superiors_direct_complete()
1584 spin_lock_irq(&dev->parent->power.lock); in dpm_clear_superiors_direct_complete()
1585 dev->parent->power.direct_complete = false; in dpm_clear_superiors_direct_complete()
1586 spin_unlock_irq(&dev->parent->power.lock); in dpm_clear_superiors_direct_complete()
1591 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) { in dpm_clear_superiors_direct_complete()
1592 spin_lock_irq(&link->supplier->power.lock); in dpm_clear_superiors_direct_complete()
1593 link->supplier->power.direct_complete = false; in dpm_clear_superiors_direct_complete()
1594 spin_unlock_irq(&link->supplier->power.lock); in dpm_clear_superiors_direct_complete()
1601 * __device_suspend - Execute "suspend" callbacks for given device.
1603 * @state: PM transition of the system being carried out.
1619 dev->power.direct_complete = false; in __device_suspend()
1624 * Wait for possible runtime PM transitions of the device in progress in __device_suspend()
1626 * resume it before proceeding with invoking the system-wide suspend in __device_suspend()
1629 * If the system-wide suspend callbacks below change the configuration in __device_suspend()
1630 * of the device, they must disable runtime PM for it or otherwise in __device_suspend()
1631 * ensure that its runtime-resume callbacks will not be confused by that in __device_suspend()
1637 dev->power.direct_complete = false; in __device_suspend()
1638 async_error = -EBUSY; in __device_suspend()
1642 if (dev->power.syscore) in __device_suspend()
1647 dev->power.direct_complete = false; in __device_suspend()
1649 if (dev->power.direct_complete) { in __device_suspend()
1653 pm_dev_dbg(dev, state, "direct-complete "); in __device_suspend()
1659 dev->power.direct_complete = false; in __device_suspend()
1662 dev->power.may_skip_resume = true; in __device_suspend()
1663 dev->power.must_resume = !dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME); in __device_suspend()
1668 if (dev->pm_domain) { in __device_suspend()
1670 callback = pm_op(&dev->pm_domain->ops, state); in __device_suspend()
1674 if (dev->type && dev->type->pm) { in __device_suspend()
1676 callback = pm_op(dev->type->pm, state); in __device_suspend()
1680 if (dev->class && dev->class->pm) { in __device_suspend()
1682 callback = pm_op(dev->class->pm, state); in __device_suspend()
1686 if (dev->bus) { in __device_suspend()
1687 if (dev->bus->pm) { in __device_suspend()
1688 info = "bus "; in __device_suspend()
1689 callback = pm_op(dev->bus->pm, state); in __device_suspend()
1690 } else if (dev->bus->suspend) { in __device_suspend()
1691 pm_dev_dbg(dev, state, "legacy bus "); in __device_suspend()
1692 error = legacy_suspend(dev, state, dev->bus->suspend, in __device_suspend()
1693 "legacy bus "); in __device_suspend()
1699 if (!callback && dev->driver && dev->driver->pm) { in __device_suspend()
1701 callback = pm_op(dev->driver->pm, state); in __device_suspend()
1708 dev->power.is_suspended = true; in __device_suspend()
1710 dev->power.wakeup_path = true; in __device_suspend()
1723 complete_all(&dev->power.completion); in __device_suspend()
1751 * dpm_suspend - Execute "suspend" callbacks for all non-sysdev devices.
1752 * @state: PM transition of the system being carried out.
1782 } else if (!list_empty(&dev->power.entry)) { in dpm_suspend()
1783 list_move(&dev->power.entry, &dpm_suspended_list); in dpm_suspend()
1809 * device_prepare - Prepare a device for system power transition.
1811 * @state: PM transition of the system being carried out.
1813 * Execute the ->prepare() callback(s) for given device. No new children of the
1829 if (dev->power.syscore) in device_prepare()
1834 dev->power.wakeup_path = false; in device_prepare()
1836 if (dev->power.no_pm_callbacks) in device_prepare()
1839 if (dev->pm_domain) in device_prepare()
1840 callback = dev->pm_domain->ops.prepare; in device_prepare()
1841 else if (dev->type && dev->type->pm) in device_prepare()
1842 callback = dev->type->pm->prepare; in device_prepare()
1843 else if (dev->class && dev->class->pm) in device_prepare()
1844 callback = dev->class->pm->prepare; in device_prepare()
1845 else if (dev->bus && dev->bus->pm) in device_prepare()
1846 callback = dev->bus->pm->prepare; in device_prepare()
1848 if (!callback && dev->driver && dev->driver->pm) in device_prepare()
1849 callback = dev->driver->pm->prepare; in device_prepare()
1863 * A positive return value from ->prepare() means "this device appears in device_prepare()
1864 * to be runtime-suspended and its state is fine, so if it really is in device_prepare()
1865 * runtime-suspended, you can leave it in that state provided that you in device_prepare()
1869 spin_lock_irq(&dev->power.lock); in device_prepare()
1870 dev->power.direct_complete = state.event == PM_EVENT_SUSPEND && in device_prepare()
1871 (ret > 0 || dev->power.no_pm_callbacks) && in device_prepare()
1873 spin_unlock_irq(&dev->power.lock); in device_prepare()
1878 * dpm_prepare - Prepare all non-sysdev devices for a system PM transition.
1879 * @state: PM transition of the system being carried out.
1881 * Execute the ->prepare() callback(s) for all devices.
1919 dev->power.is_prepared = true; in dpm_prepare()
1920 if (!list_empty(&dev->power.entry)) in dpm_prepare()
1921 list_move_tail(&dev->power.entry, &dpm_prepared_list); in dpm_prepare()
1922 } else if (error == -EAGAIN) { in dpm_prepare()
1941 * dpm_suspend_start - Prepare devices for PM transition and suspend them.
1942 * @state: PM transition of the system being carried out.
1944 * Prepare all non-sysdev devices for system PM transition and execute "suspend"
1971 * device_pm_wait_for_dev - Wait for suspend/resume of a device to complete.
1977 dpm_wait(dev, subordinate->power.async_suspend); in device_pm_wait_for_dev()
1983 * dpm_for_each_dev - device iterator.
2009 return !ops->prepare && in pm_ops_is_empty()
2010 !ops->suspend && in pm_ops_is_empty()
2011 !ops->suspend_late && in pm_ops_is_empty()
2012 !ops->suspend_noirq && in pm_ops_is_empty()
2013 !ops->resume_noirq && in pm_ops_is_empty()
2014 !ops->resume_early && in pm_ops_is_empty()
2015 !ops->resume && in pm_ops_is_empty()
2016 !ops->complete; in pm_ops_is_empty()
2023 spin_lock_irqsave(&dev->power.lock, flags); in device_pm_check_callbacks()
2024 dev->power.no_pm_callbacks = in device_pm_check_callbacks()
2025 (!dev->bus || (pm_ops_is_empty(dev->bus->pm) && in device_pm_check_callbacks()
2026 !dev->bus->suspend && !dev->bus->resume)) && in device_pm_check_callbacks()
2027 (!dev->class || pm_ops_is_empty(dev->class->pm)) && in device_pm_check_callbacks()
2028 (!dev->type || pm_ops_is_empty(dev->type->pm)) && in device_pm_check_callbacks()
2029 (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) && in device_pm_check_callbacks()
2030 (!dev->driver || (pm_ops_is_empty(dev->driver->pm) && in device_pm_check_callbacks()
2031 !dev->driver->suspend && !dev->driver->resume)); in device_pm_check_callbacks()
2032 spin_unlock_irqrestore(&dev->power.lock, flags); in device_pm_check_callbacks()