2. pm runtime introduction
2.1 pm_runtimedocumentation
Documentation/power/runtime_pm.txt
2.2 RuntimePM Device Fields
Common for runtime PM status:
.runtime_status = RPM_SUSPENDED;
.disable_depth = 1;
.runtime_error = 0;
.usage_count, 0);
.runtime_auto = true;
rpm_idle:
.idle_notification = false;
[wangshm5]For rpm_idle since no suspending/resuming statues to markthis feature in progress
For children:
power.child_count
.ingnor_children
For ASYNC mode:
.request_pending = false;
.request = RPM_REQ_NONE;
.deferred_resume = false;
For auto suspending feature:
.accounting_timestamp = jiffies;
.timer_expires = 0;
.last_busy -called after suspend immediately
.autosuspend_delay;
. use_autosuspend;
2.3 somepm_runtime helper function
2.3.1 rpm_resume
pm_runtime_resume(structdevice *dev) ó rpm_resume(dev,0)
pm_request_resume(structdevice *dev) ó rpm_resume(dev,RPM_ASYNC)
pm_runtime_get_sync(structdevice *dev) ó usage_count++;rpm_resume(dev,0)
pm_runtime_get(structdevice *dev) ó usage_count++;pm_resume(dev,RPM_ASYNC)
* If the resume callback returns an error code, the PMcore regards this as a fatal error and will refuse to run the helper functions until its status is directly set to either'active', or 'suspended' (by means ofspecial helper functions provided by the PM core for this purpose).
[wangshm5] NO -EBUSY or -EAGIAN, directlyother error code
* If->runtime_resume() is about to be executed or there's a pending request to execute it, the other callbacks will notbe executed for the same device.
* A request to execute->runtime_resume() will cancel any pending or scheduled requests to execute the othercallbacks for the same device, exceptfor scheduled autosuspends.
[wangshm5]Nearly future, IO operationneeded, so cancel other
2.3.2 Rpm_idle
pm_runtime_idle(struct device