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>
88 return "(unknown PM event)"; in pm_verb()
93 * device_pm_sleep_init - Initialize system suspend-related device fields.
98 dev->power.is_prepared = false; in device_pm_sleep_init()
99 dev->power.is_suspended = false; in device_pm_sleep_init()
100 dev->power.is_noirq_suspended = false; in device_pm_sleep_init()
101 dev->power.is_late_suspended = false; in device_pm_sleep_init()
102 init_completion(&dev->power.completion); in device_pm_sleep_init()
103 complete_all(&dev->power.completion); in device_pm_sleep_init()
104 dev->power.wakeup = NULL; in device_pm_sleep_init()
105 INIT_LIST_HEAD(&dev->power.entry); in device_pm_sleep_init()
109 * device_pm_lock - Lock the list of active devices used by the PM core.
117 * device_pm_unlock - Unlock the list of active devices used by the PM core.
125 * device_pm_add - Add a device to the PM core's list of active devices.
130 /* Skip PM setup/initialization. */ in device_pm_add()
135 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); in device_pm_add()
138 if (dev->parent && dev->parent->power.is_prepared) in device_pm_add()
140 dev_name(dev->parent)); in device_pm_add()
141 list_add_tail(&dev->power.entry, &dpm_list); in device_pm_add()
142 dev->power.in_dpm_list = true; in device_pm_add()
147 * device_pm_remove - Remove a device from the PM core's list of active devices.
156 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); in device_pm_remove()
157 complete_all(&dev->power.completion); in device_pm_remove()
159 list_del_init(&dev->power.entry); in device_pm_remove()
160 dev->power.in_dpm_list = false; in device_pm_remove()
168 * device_pm_move_before - Move device in the PM core's list of active devices.
175 deva->bus ? deva->bus->name : "No Bus", dev_name(deva), in device_pm_move_before()
176 devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); in device_pm_move_before()
178 list_move_tail(&deva->power.entry, &devb->power.entry); in device_pm_move_before()
182 * device_pm_move_after - Move device in the PM core's list of active devices.
189 deva->bus ? deva->bus->name : "No Bus", dev_name(deva), in device_pm_move_after()
190 devb->bus ? devb->bus->name : "No Bus", dev_name(devb)); in device_pm_move_after()
192 list_move(&deva->power.entry, &devb->power.entry); in device_pm_move_after()
196 * device_pm_move_last - Move device to end of the PM core's list of devices.
202 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); in device_pm_move_last()
203 list_move_tail(&dev->power.entry, &dpm_list); in device_pm_move_last()
213 dev->parent ? dev_name(dev->parent) : "none"); in initcall_debug_start()
231 * dpm_wait - Wait for a PM operation to complete.
240 if (async || (pm_async_enabled && dev->power.async_suspend)) in dpm_wait()
241 wait_for_completion(&dev->power.completion); in dpm_wait()
269 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) in dpm_wait_for_suppliers()
270 if (READ_ONCE(link->status) != DL_STATE_DORMANT) in dpm_wait_for_suppliers()
271 dpm_wait(link->supplier, async); in dpm_wait_for_suppliers()
294 parent = get_device(dev->parent); in dpm_wait_for_superior()
326 list_for_each_entry_rcu_locked(link, &dev->links.consumers, s_node) in dpm_wait_for_consumers()
327 if (READ_ONCE(link->status) != DL_STATE_DORMANT) in dpm_wait_for_consumers()
328 dpm_wait(link->consumer, async); in dpm_wait_for_consumers()
340 * pm_op - Return the PM operation appropriate for given PM event.
341 * @ops: PM operations to choose from.
342 * @state: PM transition of the system being carried out.
349 return ops->suspend; in pm_op()
351 return ops->resume; in pm_op()
356 return ops->freeze; in pm_op()
358 return ops->poweroff; in pm_op()
361 return ops->thaw; in pm_op()
363 return ops->restore; in pm_op()
371 * pm_late_early_op - Return the PM operation appropriate for given PM event.
372 * @ops: PM operations to choose from.
373 * @state: PM transition of the system being carried out.
375 * Runtime PM is disabled for @dev while this function is being executed.
383 return ops->suspend_late; in pm_late_early_op()
385 return ops->resume_early; in pm_late_early_op()
390 return ops->freeze_late; in pm_late_early_op()
392 return ops->poweroff_late; in pm_late_early_op()
395 return ops->thaw_early; in pm_late_early_op()
397 return ops->restore_early; in pm_late_early_op()
405 * pm_noirq_op - Return the PM operation appropriate for given PM event.
406 * @ops: PM operations to choose from.
407 * @state: PM transition of the system being carried out.
417 return ops->suspend_noirq; in pm_noirq_op()
419 return ops->resume_noirq; in pm_noirq_op()
424 return ops->freeze_noirq; in pm_noirq_op()
426 return ops->poweroff_noirq; in pm_noirq_op()
429 return ops->thaw_noirq; in pm_noirq_op()
431 return ops->restore_noirq; in pm_noirq_op()
442 ", may wakeup" : "", dev->power.driver_flags); in pm_dev_dbg()
505 * dpm_watchdog_handler - Driver suspend / resume watchdog handler.
506 * @t: The timer that PM watchdog depends on.
510 * capture a crash-dump in pstore.
516 dev_emerg(wd->dev, "**** DPM device timeout ****\n"); in dpm_watchdog_handler()
517 show_stack(wd->tsk, NULL, KERN_EMERG); in dpm_watchdog_handler()
519 dev_driver_string(wd->dev), dev_name(wd->dev)); in dpm_watchdog_handler()
523 * dpm_watchdog_set - Enable pm watchdog for given device.
529 struct timer_list *timer = &wd->timer; in dpm_watchdog_set()
531 wd->dev = dev; in dpm_watchdog_set()
532 wd->tsk = current; in dpm_watchdog_set()
536 timer->expires = jiffies + HZ * CONFIG_DPM_WATCHDOG_TIMEOUT; in dpm_watchdog_set()
541 * dpm_watchdog_clear - Disable suspend/resume watchdog.
546 struct timer_list *timer = &wd->timer; in dpm_watchdog_clear()
557 /*------------------------- Resume routines -------------------------*/
560 * dev_pm_skip_resume - System-wide device resume optimization check.
564 * - %false if the transition under way is RESTORE.
565 * - Return value of dev_pm_skip_suspend() if the transition under way is THAW.
566 * - The logical negation of %power.must_resume otherwise (that is, when the
577 return !dev->power.must_resume; in dev_pm_skip_resume()
582 return dev->power.async_suspend && pm_async_enabled in is_async()
588 reinit_completion(&dev->power.completion); in dpm_async_fn()
591 dev->power.async_in_progress = true; in dpm_async_fn()
605 dev->power.async_in_progress = false; in dpm_async_fn()
610 * device_resume_noirq - Execute a "noirq resume" callback for given device.
612 * @state: PM transition of the system being carried out.
628 if (dev->power.syscore || dev->power.direct_complete) in device_resume_noirq()
631 if (!dev->power.is_noirq_suspended) in device_resume_noirq()
641 * this device later, it needs to appear as "suspended" to PM-runtime, in device_resume_noirq()
644 * Otherwise, the device is going to be resumed, so set its PM-runtime in device_resume_noirq()
653 if (dev->pm_domain) { in device_resume_noirq()
655 callback = pm_noirq_op(&dev->pm_domain->ops, state); in device_resume_noirq()
656 } else if (dev->type && dev->type->pm) { in device_resume_noirq()
658 callback = pm_noirq_op(dev->type->pm, state); in device_resume_noirq()
659 } else if (dev->class && dev->class->pm) { in device_resume_noirq()
661 callback = pm_noirq_op(dev->class->pm, state); in device_resume_noirq()
662 } else if (dev->bus && dev->bus->pm) { in device_resume_noirq()
663 info = "noirq bus "; in device_resume_noirq()
664 callback = pm_noirq_op(dev->bus->pm, state); in device_resume_noirq()
672 if (dev->driver && dev->driver->pm) { in device_resume_noirq()
674 callback = pm_noirq_op(dev->driver->pm, state); in device_resume_noirq()
681 dev->power.is_noirq_suspended = false; in device_resume_noirq()
684 complete_all(&dev->power.completion); in device_resume_noirq()
716 * wait for the "non-async" ones they don't depend on. in dpm_noirq_resume_devices()
723 list_move_tail(&dev->power.entry, &dpm_late_early_list); in dpm_noirq_resume_devices()
725 if (!dev->power.async_in_progress) { in dpm_noirq_resume_devices()
747 * dpm_resume_noirq - Execute "noirq resume" callbacks for all devices.
748 * @state: PM transition of the system being carried out.
762 * device_resume_early - Execute an "early resume" callback for given device.
764 * @state: PM transition of the system being carried out.
767 * Runtime PM is disabled for @dev while this function is being executed.
778 if (dev->power.syscore || dev->power.direct_complete) in device_resume_early()
781 if (!dev->power.is_late_suspended) in device_resume_early()
787 if (dev->pm_domain) { in device_resume_early()
789 callback = pm_late_early_op(&dev->pm_domain->ops, state); in device_resume_early()
790 } else if (dev->type && dev->type->pm) { in device_resume_early()
792 callback = pm_late_early_op(dev->type->pm, state); in device_resume_early()
793 } else if (dev->class && dev->class->pm) { in device_resume_early()
795 callback = pm_late_early_op(dev->class->pm, state); in device_resume_early()
796 } else if (dev->bus && dev->bus->pm) { in device_resume_early()
797 info = "early bus "; in device_resume_early()
798 callback = pm_late_early_op(dev->bus->pm, state); in device_resume_early()
806 if (dev->driver && dev->driver->pm) { in device_resume_early()
808 callback = pm_late_early_op(dev->driver->pm, state); in device_resume_early()
815 dev->power.is_late_suspended = false; in device_resume_early()
821 complete_all(&dev->power.completion); in device_resume_early()
839 * dpm_resume_early - Execute "early resume" callbacks for all devices.
840 * @state: PM transition of the system being carried out.
856 * wait for the "non-async" ones they don't depend on. in dpm_resume_early()
863 list_move_tail(&dev->power.entry, &dpm_suspended_list); in dpm_resume_early()
865 if (!dev->power.async_in_progress) { in dpm_resume_early()
887 * dpm_resume_start - Execute "noirq" and "early" device callbacks.
888 * @state: PM transition of the system being carried out.
898 * device_resume - Execute "resume" callbacks for given device.
900 * @state: PM transition of the system being carried out.
913 if (dev->power.syscore) in device_resume()
916 if (dev->power.direct_complete) { in device_resume()
932 dev->power.is_prepared = false; in device_resume()
934 if (!dev->power.is_suspended) in device_resume()
937 if (dev->pm_domain) { in device_resume()
939 callback = pm_op(&dev->pm_domain->ops, state); in device_resume()
943 if (dev->type && dev->type->pm) { in device_resume()
945 callback = pm_op(dev->type->pm, state); in device_resume()
949 if (dev->class && dev->class->pm) { in device_resume()
951 callback = pm_op(dev->class->pm, state); in device_resume()
955 if (dev->bus) { in device_resume()
956 if (dev->bus->pm) { in device_resume()
957 info = "bus "; in device_resume()
958 callback = pm_op(dev->bus->pm, state); in device_resume()
959 } else if (dev->bus->resume) { in device_resume()
960 info = "legacy bus "; in device_resume()
961 callback = dev->bus->resume; in device_resume()
967 if (!callback && dev->driver && dev->driver->pm) { in device_resume()
969 callback = pm_op(dev->driver->pm, state); in device_resume()
974 dev->power.is_suspended = false; in device_resume()
981 complete_all(&dev->power.completion); in device_resume()
1001 * dpm_resume - Execute "resume" callbacks for non-sysdev devices.
1002 * @state: PM transition of the system being carried out.
1022 * wait for the "non-async" ones they don't depend on. in dpm_resume()
1029 list_move_tail(&dev->power.entry, &dpm_prepared_list); in dpm_resume()
1031 if (!dev->power.async_in_progress) { in dpm_resume()
1055 * device_complete - Complete a PM transition for given device.
1057 * @state: PM transition of the system being carried out.
1064 if (dev->power.syscore) in device_complete()
1069 if (dev->pm_domain) { in device_complete()
1071 callback = dev->pm_domain->ops.complete; in device_complete()
1072 } else if (dev->type && dev->type->pm) { in device_complete()
1074 callback = dev->type->pm->complete; in device_complete()
1075 } else if (dev->class && dev->class->pm) { in device_complete()
1077 callback = dev->class->pm->complete; in device_complete()
1078 } else if (dev->bus && dev->bus->pm) { in device_complete()
1079 info = "completing bus "; in device_complete()
1080 callback = dev->bus->pm->complete; in device_complete()
1083 if (!callback && dev->driver && dev->driver->pm) { in device_complete()
1085 callback = dev->driver->pm->complete; in device_complete()
1100 * dpm_complete - Complete a PM transition for all non-sysdev devices.
1101 * @state: PM transition of the system being carried out.
1103 * Execute the ->complete() callbacks for all devices whose PM status is not
1119 dev->power.is_prepared = false; in dpm_complete()
1120 list_move(&dev->power.entry, &list); in dpm_complete()
1135 /* Allow device probing and trigger re-probing of deferred devices */ in dpm_complete()
1141 * dpm_resume_end - Execute "resume" callbacks and complete system transition.
1142 * @state: PM transition of the system being carried out.
1144 * Execute "resume" callbacks for all devices and complete the PM transition of
1155 /*------------------------- Suspend routines -------------------------*/
1158 * resume_event - Return a "resume" message for given "suspend" sleep state.
1159 * @sleep_state: PM message representing a sleep state.
1161 * Return a PM message representing the resume event corresponding to given
1183 if (dev->parent) in dpm_superior_set_must_resume()
1184 dev->parent->power.must_resume = true; in dpm_superior_set_must_resume()
1188 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) in dpm_superior_set_must_resume()
1189 link->supplier->power.must_resume = true; in dpm_superior_set_must_resume()
1195 * device_suspend_noirq - Execute a "noirq suspend" callback for given device.
1197 * @state: PM transition of the system being carried out.
1217 if (dev->power.syscore || dev->power.direct_complete) in device_suspend_noirq()
1220 if (dev->pm_domain) { in device_suspend_noirq()
1222 callback = pm_noirq_op(&dev->pm_domain->ops, state); in device_suspend_noirq()
1223 } else if (dev->type && dev->type->pm) { in device_suspend_noirq()
1225 callback = pm_noirq_op(dev->type->pm, state); in device_suspend_noirq()
1226 } else if (dev->class && dev->class->pm) { in device_suspend_noirq()
1228 callback = pm_noirq_op(dev->class->pm, state); in device_suspend_noirq()
1229 } else if (dev->bus && dev->bus->pm) { in device_suspend_noirq()
1230 info = "noirq bus "; in device_suspend_noirq()
1231 callback = pm_noirq_op(dev->bus->pm, state); in device_suspend_noirq()
1239 if (dev->driver && dev->driver->pm) { in device_suspend_noirq()
1241 callback = pm_noirq_op(dev->driver->pm, state); in device_suspend_noirq()
1254 dev->power.is_noirq_suspended = true; in device_suspend_noirq()
1258 * system suspend (as indicated by their PM-runtime usage counters) in device_suspend_noirq()
1262 if (atomic_read(&dev->power.usage_count) > 1 || in device_suspend_noirq()
1264 dev->power.may_skip_resume)) in device_suspend_noirq()
1265 dev->power.must_resume = true; in device_suspend_noirq()
1267 if (dev->power.must_resume) in device_suspend_noirq()
1271 complete_all(&dev->power.completion); in device_suspend_noirq()
1299 list_move(&dev->power.entry, &dpm_noirq_list); in dpm_noirq_suspend_devices()
1333 * dpm_suspend_noirq - Execute "noirq suspend" callbacks for all devices.
1334 * @state: PM transition of the system being carried out.
1337 * "noirq" suspend callbacks for all non-sysdev devices.
1355 struct device *parent = dev->parent; in dpm_propagate_wakeup_to_parent()
1360 spin_lock_irq(&parent->power.lock); in dpm_propagate_wakeup_to_parent()
1362 if (device_wakeup_path(dev) && !parent->power.ignore_children) in dpm_propagate_wakeup_to_parent()
1363 parent->power.wakeup_path = true; in dpm_propagate_wakeup_to_parent()
1365 spin_unlock_irq(&parent->power.lock); in dpm_propagate_wakeup_to_parent()
1369 * device_suspend_late - Execute a "late suspend" callback for given device.
1371 * @state: PM transition of the system being carried out.
1374 * Runtime PM is disabled for @dev while this function is being executed.
1393 async_error = -EBUSY; in device_suspend_late()
1397 if (dev->power.syscore || dev->power.direct_complete) in device_suspend_late()
1400 if (dev->pm_domain) { in device_suspend_late()
1402 callback = pm_late_early_op(&dev->pm_domain->ops, state); in device_suspend_late()
1403 } else if (dev->type && dev->type->pm) { in device_suspend_late()
1405 callback = pm_late_early_op(dev->type->pm, state); in device_suspend_late()
1406 } else if (dev->class && dev->class->pm) { in device_suspend_late()
1408 callback = pm_late_early_op(dev->class->pm, state); in device_suspend_late()
1409 } else if (dev->bus && dev->bus->pm) { in device_suspend_late()
1410 info = "late bus "; in device_suspend_late()
1411 callback = pm_late_early_op(dev->bus->pm, state); in device_suspend_late()
1419 if (dev->driver && dev->driver->pm) { in device_suspend_late()
1421 callback = pm_late_early_op(dev->driver->pm, state); in device_suspend_late()
1435 dev->power.is_late_suspended = true; in device_suspend_late()
1439 complete_all(&dev->power.completion); in device_suspend_late()
1452 * dpm_suspend_late - Execute "late suspend" callbacks for all devices.
1453 * @state: PM transition of the system being carried out.
1472 list_move(&dev->power.entry, &dpm_late_early_list); in dpm_suspend_late()
1507 * dpm_suspend_end - Execute "late" and "noirq" device suspend callbacks.
1508 * @state: PM transition of the system being carried out.
1530 * legacy_suspend - Execute a legacy (bus or class) suspend callback for device.
1532 * @state: PM transition of the system being carried out.
1560 if (dev->parent) { in dpm_clear_superiors_direct_complete()
1561 spin_lock_irq(&dev->parent->power.lock); in dpm_clear_superiors_direct_complete()
1562 dev->parent->power.direct_complete = false; in dpm_clear_superiors_direct_complete()
1563 spin_unlock_irq(&dev->parent->power.lock); in dpm_clear_superiors_direct_complete()
1568 list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node) { in dpm_clear_superiors_direct_complete()
1569 spin_lock_irq(&link->supplier->power.lock); in dpm_clear_superiors_direct_complete()
1570 link->supplier->power.direct_complete = false; in dpm_clear_superiors_direct_complete()
1571 spin_unlock_irq(&link->supplier->power.lock); in dpm_clear_superiors_direct_complete()
1578 * device_suspend - Execute "suspend" callbacks for given device.
1580 * @state: PM transition of the system being carried out.
1596 dev->power.direct_complete = false; in device_suspend()
1601 * Wait for possible runtime PM transitions of the device in progress in device_suspend()
1603 * resume it before proceeding with invoking the system-wide suspend in device_suspend()
1606 * If the system-wide suspend callbacks below change the configuration in device_suspend()
1607 * of the device, they must disable runtime PM for it or otherwise in device_suspend()
1608 * ensure that its runtime-resume callbacks will not be confused by that in device_suspend()
1614 dev->power.direct_complete = false; in device_suspend()
1615 async_error = -EBUSY; in device_suspend()
1619 if (dev->power.syscore) in device_suspend()
1624 dev->power.direct_complete = false; in device_suspend()
1626 if (dev->power.direct_complete) { in device_suspend()
1630 pm_dev_dbg(dev, state, "direct-complete "); in device_suspend()
1636 dev->power.direct_complete = false; in device_suspend()
1639 dev->power.may_skip_resume = true; in device_suspend()
1640 dev->power.must_resume = !dev_pm_test_driver_flags(dev, DPM_FLAG_MAY_SKIP_RESUME); in device_suspend()
1645 if (dev->pm_domain) { in device_suspend()
1647 callback = pm_op(&dev->pm_domain->ops, state); in device_suspend()
1651 if (dev->type && dev->type->pm) { in device_suspend()
1653 callback = pm_op(dev->type->pm, state); in device_suspend()
1657 if (dev->class && dev->class->pm) { in device_suspend()
1659 callback = pm_op(dev->class->pm, state); in device_suspend()
1663 if (dev->bus) { in device_suspend()
1664 if (dev->bus->pm) { in device_suspend()
1665 info = "bus "; in device_suspend()
1666 callback = pm_op(dev->bus->pm, state); in device_suspend()
1667 } else if (dev->bus->suspend) { in device_suspend()
1668 pm_dev_dbg(dev, state, "legacy bus "); in device_suspend()
1669 error = legacy_suspend(dev, state, dev->bus->suspend, in device_suspend()
1670 "legacy bus "); in device_suspend()
1676 if (!callback && dev->driver && dev->driver->pm) { in device_suspend()
1678 callback = pm_op(dev->driver->pm, state); in device_suspend()
1685 dev->power.is_suspended = true; in device_suspend()
1687 dev->power.wakeup_path = true; in device_suspend()
1703 complete_all(&dev->power.completion); in device_suspend()
1717 * dpm_suspend - Execute "suspend" callbacks for all non-sysdev devices.
1718 * @state: PM transition of the system being carried out.
1739 list_move(&dev->power.entry, &dpm_suspended_list); in dpm_suspend()
1773 * device_prepare - Prepare a device for system power transition.
1775 * @state: PM transition of the system being carried out.
1777 * Execute the ->prepare() callback(s) for given device. No new children of the
1793 if (dev->power.syscore) in device_prepare()
1798 dev->power.wakeup_path = false; in device_prepare()
1800 if (dev->power.no_pm_callbacks) in device_prepare()
1803 if (dev->pm_domain) in device_prepare()
1804 callback = dev->pm_domain->ops.prepare; in device_prepare()
1805 else if (dev->type && dev->type->pm) in device_prepare()
1806 callback = dev->type->pm->prepare; in device_prepare()
1807 else if (dev->class && dev->class->pm) in device_prepare()
1808 callback = dev->class->pm->prepare; in device_prepare()
1809 else if (dev->bus && dev->bus->pm) in device_prepare()
1810 callback = dev->bus->pm->prepare; in device_prepare()
1812 if (!callback && dev->driver && dev->driver->pm) in device_prepare()
1813 callback = dev->driver->pm->prepare; in device_prepare()
1827 * A positive return value from ->prepare() means "this device appears in device_prepare()
1828 * to be runtime-suspended and its state is fine, so if it really is in device_prepare()
1829 * runtime-suspended, you can leave it in that state provided that you in device_prepare()
1833 spin_lock_irq(&dev->power.lock); in device_prepare()
1834 dev->power.direct_complete = state.event == PM_EVENT_SUSPEND && in device_prepare()
1835 (ret > 0 || dev->power.no_pm_callbacks) && in device_prepare()
1837 spin_unlock_irq(&dev->power.lock); in device_prepare()
1842 * dpm_prepare - Prepare all non-sysdev devices for a system PM transition.
1843 * @state: PM transition of the system being carried out.
1845 * Execute the ->prepare() callback(s) for all devices.
1883 dev->power.is_prepared = true; in dpm_prepare()
1884 if (!list_empty(&dev->power.entry)) in dpm_prepare()
1885 list_move_tail(&dev->power.entry, &dpm_prepared_list); in dpm_prepare()
1886 } else if (error == -EAGAIN) { in dpm_prepare()
1905 * dpm_suspend_start - Prepare devices for PM transition and suspend them.
1906 * @state: PM transition of the system being carried out.
1908 * Prepare all non-sysdev devices for system PM transition and execute "suspend"
1935 * device_pm_wait_for_dev - Wait for suspend/resume of a device to complete.
1941 dpm_wait(dev, subordinate->power.async_suspend); in device_pm_wait_for_dev()
1947 * dpm_for_each_dev - device iterator.
1973 return !ops->prepare && in pm_ops_is_empty()
1974 !ops->suspend && in pm_ops_is_empty()
1975 !ops->suspend_late && in pm_ops_is_empty()
1976 !ops->suspend_noirq && in pm_ops_is_empty()
1977 !ops->resume_noirq && in pm_ops_is_empty()
1978 !ops->resume_early && in pm_ops_is_empty()
1979 !ops->resume && in pm_ops_is_empty()
1980 !ops->complete; in pm_ops_is_empty()
1987 spin_lock_irqsave(&dev->power.lock, flags); in device_pm_check_callbacks()
1988 dev->power.no_pm_callbacks = in device_pm_check_callbacks()
1989 (!dev->bus || (pm_ops_is_empty(dev->bus->pm) && in device_pm_check_callbacks()
1990 !dev->bus->suspend && !dev->bus->resume)) && in device_pm_check_callbacks()
1991 (!dev->class || pm_ops_is_empty(dev->class->pm)) && in device_pm_check_callbacks()
1992 (!dev->type || pm_ops_is_empty(dev->type->pm)) && in device_pm_check_callbacks()
1993 (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) && in device_pm_check_callbacks()
1994 (!dev->driver || (pm_ops_is_empty(dev->driver->pm) && in device_pm_check_callbacks()
1995 !dev->driver->suspend && !dev->driver->resume)); in device_pm_check_callbacks()
1996 spin_unlock_irqrestore(&dev->power.lock, flags); in device_pm_check_callbacks()