函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\suspend.c Create Date:2022-07-27 10:58:33
Last Modify:2020-03-17 14:47:48 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:static int enter_state(suspend_state_t state)

返回类型:int

参数:

类型参数名称
suspend_state_tstate
551  trace_suspend_resume(TPS("suspend_enter"), state, true)
552  如果state恒等于PM_SUSPEND_TO_IDLE则否则如果非valid_state(state)则
560  返回:负EINVAL
562  如果非mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically则返回:负EBUSY
565  如果state恒等于PM_SUSPEND_TO_IDLEs2idle_begin()
568  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_SUSPEND_SKIP_SYNC)则
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  如果error则转到:Unlock
580  如果suspend_test(TEST_FREEZER)则转到: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  返回:error
调用者
名称描述
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.