Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\suspend.c Create Date:2022-07-28 09:58:20
Last Modify:2020-03-17 14:47:48 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:suspend_enter - Make the system enter the given sleep state.*@state: System sleep state to enter.*@wakeup: Returns information that the sleep state should not be re-entered.* This function should be called after devices have been suspended.

Proto:static int suspend_enter(suspend_state_t state, bool *wakeup)

Type:int

Parameter:

TypeParameterName
suspend_state_tstate
bool *wakeup
395  error = platform_suspend_prepare(state)
396  If error Then Go to Platform_finish
399  error = dpm_suspend_late(PMSG_SUSPEND)
400  If error Then
401  pr_err("late suspend of devices failed\n")
402  Go to Platform_finish
404  error = platform_suspend_prepare_late(state)
405  If error Then Go to Devices_early_resume
408  error = dpm_suspend_noirq(PMSG_SUSPEND)
409  If error Then
410  pr_err("noirq suspend of devices failed\n")
411  Go to Platform_early_resume
413  error = platform_suspend_prepare_noirq(state)
414  If error Then Go to Platform_wake
417  If suspend_test(TEST_PLATFORM) Then Go to Platform_wake
420  If state == PM_SUSPEND_TO_IDLE Then
421  s2idle_loop()
422  Go to Platform_wake
425  error = suspend_disable_secondary_cpus()
426  If error || suspend_test(TEST_CPUS) Then Go to Enable_cpus
429  default implementation
430  BUG_ON(!Some architectures don't define arch_irqs_disabled(), so even if either* definition would be fine we need to use different ones for the time being* to avoid build issues.())
432  Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. = SYSTEM_SUSPEND
434  error = syscore_suspend()
435  If Not error Then
436  wakeup = pm_wakeup_pending()
437  If Not (suspend_test(TEST_CORE) || wakeup) Then
438  trace_suspend_resume(TPS("machine_suspend"), state, true)
440  error = enter(state)
441  trace_suspend_resume(TPS("machine_suspend"), state, false)
443  Else if wakeup Then
444  error = -EBUSY
446  syscore_resume()
449  Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. = SYSTEM_RUNNING
451  default implementation
452  BUG_ON(Some architectures don't define arch_irqs_disabled(), so even if either* definition would be fine we need to use different ones for the time being* to avoid build issues.())
454  Enable_cpus :
455  suspend_enable_secondary_cpus()
457  Platform_wake :
458  platform_resume_noirq(state)
459  dpm_resume_noirq(PMSG_RESUME)
461  Platform_early_resume :
462  platform_resume_early(state)
464  Devices_early_resume :
465  dpm_resume_early(PMSG_RESUME)
467  Platform_finish :
468  platform_resume_finish(state)
469  Return error
Caller
NameDescribe
suspend_devices_and_entersuspend_devices_and_enter - Suspend devices and enter system sleep state.*@state: System sleep state to enter.