pm runtime management

本文详细介绍了Linux设备电源管理中pm_runtime的使用,包括pm_runtime介绍、设备字段、助手函数以及状态转换。重点讨论了rpm_resume、rpm_idle、rpm_suspend等函数的工作原理和应用场景,强调了电源管理的规则和提示。
摘要由CSDN通过智能技术生成

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值