Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:r_state - Do common work needed to enter system sleep state.*@state: System sleep state to enter.* Make sure that no one else is trying to put the system into a sleep state.* Fail if that's not the case. Otherwise, prepare for system suspend, make the

Proto:static int enter_state(suspend_state_t state)

Type:int

Parameter:

TypeParameterName
suspend_state_tstate
551  trace_suspend_resume(TPS("suspend_enter"), state, true)
552  If state == PM_SUSPEND_TO_IDLE Then Else if Not valid_state(state) Then
560  Return -EINVAL
562  If Not mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically Then Return -EBUSY
565  If state == PM_SUSPEND_TO_IDLE Then s2idle_begin()
568  If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_SUSPEND_SKIP_SYNC) Then
569  trace_suspend_resume(TPS("sync_filesystems"), 0, true)
570  ksys_sync_helper()
571  trace_suspend_resume(TPS("sync_filesystems"), 0, false)
574  pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state])
575  pm_suspend_clear_flags()
576  error = suspend_prepare - Prepare for entering system sleep state.* Common code run for every system sleep state that can be entered (except for* hibernation). Run suspend notifiers, allocate the "suspend" console and* freeze processes.
577  If error Then Go to Unlock
580  If suspend_test(TEST_FREEZER) Then Go to Finish
583  trace_suspend_resume(TPS("suspend_enter"), state, false)
584  pm_pr_dbg("Suspending system (%s)\n", mem_sleep_labels[state])
585  pm_restrict_gfp_mask()
586  error = suspend_devices_and_enter - Suspend devices and enter system sleep state.*@state: System sleep state to enter.
587  pm_restore_gfp_mask()
589  Finish :
590  events_check_enabled = false
591  pm_pr_dbg("Finishing wakeup.\n")
592  suspend_finish - Clean up before finishing the suspend sequence.* Call platform code to clean up, restart processes, and free the console that* we've allocated. This routine is not called for hibernation.
593  Unlock :
594  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
595  Return error
Caller
NameDescribe
pm_suspendpm_suspend - Externally visible function for suspending the system.*@state: System sleep state to enter.* Check if the value of @state represents one of the supported states,* execute enter_state() and update system suspend statistics.