梳理一遍,记下以防止遗忘。
state_store()
request_suspend_state( ); --- earlysuspend.c
queue_up_early_suspend_work(&early_suspend_work);
early_suspend
queue_work(suspend_wq, &suspend_work);
pm_suspend(suspend_state); --- static DECLARE_WORK(suspend_work, try_to_suspend); ---- ./kernel/power/suspend.c
enter_state
suspend_sync --- Syncing filesystems
suspend_prepare
-> suspend_freeze_processes ==> pm_notifier_call_chain(PM_SUSPEND_PREPARE); driver/sysbsystem the last chance to do their job.
==> freeze_processes() & freeze_kernel_threads()
suspend_devices_and_enter
-> suspend_ops->begin();
->dpm_suspend_start ==> device_prepare() 三> dev->driver->pm->prepare()
==> dpm_suspend() 三> Execute "suspend" callbacks for given device.
->suspend_enter
==> dpm_suspend_end();
三> dpm_suspend_noirq()
四> Execute "noirq suspend" callbacks for all devices. The majority device drivers don't need it. BUS like pci allow devices to share interrup vectors, need it.
==>suspend_ops->prepare_late()
==> syscore_suspend();
==>pm_wakeup_pending();
==>disable_nonboot_cpus
==>syscore_suspend()
==> pm_wakeup_pending()
==> ops->suspend();
12