唤醒后,会返回,继续操作, 、start 、 、->end等等 。
中
static void suspend_finish(void){suspend_thaw_processes();pm_notifier_call_chain(PM_POST_SUSPEND);pm_restore_console();}a)恢复所有的用户空间进程和内核线程等appb)发送suspend结束的通知 。c)将console切换回原来的 。
驱动程序里相关的电源管理函数的调用过程:
休眠: —>—>—>
唤醒: —>—>–>
整个休眠流程框架如下:
【电源管理休眠流程梳理】------------------------------state_store (kernel/power/main.c)pm_suspend (kernel/power/suspend.c)enter_state (kernel/power/suspend.c)suspend_prepare (kernel/power/suspend.c)pm_prepare_console (kernel/power/console.c)pm_notifier_call_chain(PM_SUSPEND_PREPARE); (kernel/power/main.c)// 通知所有关心"休眠消息"的驱动程序suspend_freeze_processes (kernel/power/power.h) // 冻结APP和内核线程suspend_devices_and_enter (kernel/power/suspend.c) // 让设备进入休眠状态suspend_ops->begin// 如果平台相关的代码有begin函数就去调用它suspend_console (kernel/power/suspend.c)dpm_suspend_start(PMSG_SUSPEND); (drivers/base/power/main.c)dpm_prepare(state);(drivers/base/power/main.c)对于dmp_list链表中的每一个设备,都调用device_prepare(dev, state);对于该设备,调用它的dev->pm_domain->ops->prepare 或dev->type->pm->prepare或dev->class->pm->prepare或dev->bus->pm->prepare或dev->driver->pm->preparedpm_suspend(state); (drivers/base/power/main.c)// 让各类设备休眠对于dpm_prepared_list链表中的每一个设备,都调用device_suspend(dev);__device_suspend(dev, pm_transition, false);对于该设备,调用它的dev->pm_domain->ops->suspend 或dev->type->pm->suspend或dev->class->pm->suspend或dev->bus->pm->suspend或dev->driver->pm->suspendsuspend_enter(state, &wakeup) (kernel/power/suspend.c)suspend_ops->prepare // 即s3c_pm_preparedpm_suspend_end(PMSG_SUSPEND);(drivers/base/power/main.c) dpm_suspend_late(state); (drivers/base/power/main.c) 对于dpm_suspended_list链表中的每一个设备,都调用device_suspend_late(dev, state);对于该设备,调用它的dev->pm_domain->ops->suspend_late或dev->type->pm->suspend_late或dev->class->pm->suspend_late或dev->bus->pm->suspend_late或dev->driver->pm->suspend_latedpm_suspend_noirq对于dpm_late_early_list链表中的每一个设备,都调用device_suspend_noirq(dev, state);对于该设备,调用它的dev->pm_domain->ops->suspend_noirq或dev->type->pm->suspend_noirq或dev->class->pm->suspend_noirq或dev->bus->pm->suspend_noirq或dev->driver->pm->suspend_noirqsuspend_ops->prepare_late() //disable_nonboot_cpus(); // 由于有多核cpu,关掉不是启动的cpuarch_suspend_disable_irqs();//关闭中断syscore_suspend; // 关闭核心模块suspend_ops->enter(state);// s3c_pm_enter (arch\arm\plat-samsung\pm.c)......pm_cpu_prep // s3c2410_pm_prepare (arch\arm\mach-s3c24xx\pm-s3c2410.c)GSTATUS3 = s3c_cpu_resume...... cpu_suspend(0, pm_cpu_sleep); // arch\arm\kernel\sleep.Spm_cpu_sleep (arch\arm\mach-s3c24xx\pm-s3c2410.c) // s3c2410_cpu_suspends3c2410_cpu_suspend (arch\arm\mach-s3c24xx\sleep-s3c2410.S)以上是休眠过程===================================下面开始唤醒过程按键, 导致u-boot运行, 读取GSTATUS3, 执行s3c_cpu_resume .....s3c_pm_restore_coresyscore_resumearch_suspend_enable_irqsenable_nonboot_cpussuspend_ops->wakedpm_resume_start(PMSG_RESUME); dpm_resume_noirq(state);对于dpm_noirq_list链表中的每一个设备,调用device_resume_noirq(dev, state);对于该设备,调用它的dev->pm_domain->ops->resume_noirq或dev->type->pm->resume_noirq或dev->class->pm->resume_noirq或dev->bus->pm->resume_noirq或dev->driver->pm->resume_noirqdpm_resume_early(state);对于dpm_late_early_list链表中的每一个设备,调用device_resume_early(dev, state);对于该设备,调用它的dev->pm_domain->ops->resume_early或dev->type->pm->resume_early或dev->class->pm->resume_early或dev->bus->pm->resume_early或dev->driver->pm->resume_earlysuspend_ops->finish()s3c_pm_finishdpm_resume_end(PMSG_RESUME);resume_console();suspend_finish();suspend_thaw_processes();pm_notifier_call_chain(PM_POST_SUSPEND);pm_restore_console();//返回用户空间
- 「项目管理」制定项目计划,让项目有序进行
- 二 科学工作者修炼之文献检索管理、分析、引用
- 企业电子档案管理系统,企业数字档案室建设方案
- 【电源专题】案例:充电芯片如何配置NTC偏置网络设定充电温度区间
- 图书管理系统 毕业设计
- 上 MySQL数据表管理
- win7右键中添加“获取管理员权限”
- 获得右键管理员权限/删除管理员权限
- php养老院管理系统 毕业设计源码202026
- Python with 工作原理、装饰器、回收机制、内存管理机制、拷贝、作用域等