Linux Kernel
3.7.1
|
#include <linux/sched.h>
#include <linux/export.h>
#include <linux/pm_runtime.h>
#include <trace/events/rpm.h>
#include "power.h"
Go to the source code of this file.
__pm_runtime_disable - Disable runtime PM of a device. : Device to handle. : If set, check if there's a resume request for the device.
Increment power.disable_depth for the device and if was zero previously, cancel all pending runtime PM requests for the device and wait for all operations in progress to complete. The device can be either active or suspended after its runtime PM has been disabled.
If is set and there's a resume request pending when __pm_runtime_disable() is called and power.disable_depth is zero, the function will wake up the device before disabling its runtime PM.
__pm_runtime_idle - Entry point for runtime idle operations. : Device to send idle notification for. : Flag bits.
If the RPM_GET_PUT flag is set, decrement the device's usage count and return immediately if it is larger than zero. Then carry out an idle notification, either synchronous or asynchronous.
This routine may be called in atomic context if the RPM_ASYNC flag is set, or if pm_runtime_irq_safe() has been called.
__pm_runtime_resume - Entry point for runtime resume operations. : Device to resume. : Flag bits.
If the RPM_GET_PUT flag is set, increment the device's usage count. Then carry out a resume, either synchronous or asynchronous.
This routine may be called in atomic context if the RPM_ASYNC flag is set, or if pm_runtime_irq_safe() has been called.
__pm_runtime_set_status - Set runtime PM status of a device. : Device to handle. : New runtime PM status of the device.
If runtime PM of the device is disabled or its power.runtime_error field is different from zero, the status may be changed either to RPM_ACTIVE, or to RPM_SUSPENDED, as long as that reflects the actual state of the device. However, if the device has a parent and the parent is not active, and the parent's power.ignore_children flag is unset, the device's status cannot be set to RPM_ACTIVE, so -EBUSY is returned in that case.
If successful, __pm_runtime_set_status() clears the power.runtime_error field and the device parent's counter of unsuspended children is modified to reflect the new status. If the new status is RPM_SUSPENDED, an idle notification request for the parent is submitted.
__pm_runtime_suspend - Entry point for runtime put/suspend operations. : Device to suspend. : Flag bits.
If the RPM_GET_PUT flag is set, decrement the device's usage count and return immediately if it is larger than zero. Then carry out a suspend, either synchronous or asynchronous.
This routine may be called in atomic context if the RPM_ASYNC flag is set, or if pm_runtime_irq_safe() has been called.
EXPORT_SYMBOL_GPL | ( | pm_runtime_autosuspend_expiration | ) |
EXPORT_SYMBOL_GPL | ( | pm_schedule_suspend | ) |
EXPORT_SYMBOL_GPL | ( | __pm_runtime_idle | ) |
EXPORT_SYMBOL_GPL | ( | __pm_runtime_suspend | ) |
EXPORT_SYMBOL_GPL | ( | __pm_runtime_resume | ) |
EXPORT_SYMBOL_GPL | ( | __pm_runtime_set_status | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_barrier | ) |
EXPORT_SYMBOL_GPL | ( | __pm_runtime_disable | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_enable | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_forbid | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_allow | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_no_callbacks | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_irq_safe | ) |
EXPORT_SYMBOL_GPL | ( | pm_runtime_set_autosuspend_delay | ) |
EXPORT_SYMBOL_GPL | ( | __pm_runtime_use_autosuspend | ) |
pm_runtime_barrier - Flush pending requests and wait for completions. : Device to handle.
Prevent the device from being suspended by incrementing its usage counter and if there's a pending resume request for the device, wake the device up. Next, make sure that all pending requests for the device have been flushed from pm_wq and wait for all runtime PM operations involving the device in progress to complete.
Return value: 1, if there was a resume request pending and the device had to be woken up, 0, otherwise
pm_runtime_forbid - Block runtime PM of a device. : Device to handle.
Increase the device's usage count and clear its power.runtime_auto flag, so that it cannot be suspended at run time until pm_runtime_allow() is called for it.
pm_runtime_irq_safe - Leave interrupts disabled during callbacks. : Device to handle
Set the power.irq_safe flag, which tells the PM core that the ->runtime_suspend() and ->runtime_resume() callbacks for this device should always be invoked with the spinlock held and interrupts disabled. It also causes the parent's usage counter to be permanently incremented, preventing the parent from runtime suspending – otherwise an irq-safe child might have to wait for a non-irq-safe parent.
pm_runtime_set_autosuspend_delay - Set a device's autosuspend_delay value. : Device to handle. : Value of the new delay in milliseconds.
Set the device's power.autosuspend_delay value. If it changes to negative and the power.use_autosuspend flag is set, prevent runtime suspends. If it changes the other way, allow runtime suspends.
update_pm_runtime_accounting - Update the time accounting of power states : Device to update the accounting for
In order to be able to have time accounting of the various power states (as used by programs such as PowerTOP to show the effectiveness of runtime PM), we need to track the time spent in each state. update_pm_runtime_accounting must be called each time before the runtime_status field is updated, to account the time in the old state correctly.