Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\autosleep.c Create Date:2022-07-28 10:04:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:try_to_suspend

Proto:static void try_to_suspend(struct work_struct *work)

Type:void

Parameter:

TypeParameterName
struct work_struct *work
31  If Not pm_get_wakeup_count( & initial_count, true) Then Go to out
34  mutex_lock( & Note: it is only safe to mutex_lock(&autosleep_lock) if a wakeup_source* is active, otherwise a deadlock with try_to_suspend() is possible.* Alternatively mutex_lock_interruptible() can be used. This will then fail)
36  If Not pm_save_wakeup_count(initial_count) || Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. != SYSTEM_RUNNING Then
38  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.
39  Go to out
42  If autosleep_state == PM_SUSPEND_ON Then
43  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.
44  Return
46  If autosleep_state >= PM_SUSPEND_MAX Then hibernate - Carry out system hibernation, including saving the image.
48  Else pm_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.
51  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.
53  If Not pm_get_wakeup_count( & final_count, false) Then Go to out
60  If final_count == initial_count Then schedule_timeout_uninterruptible(HZ / 2)
63  out :
64  queue_up_suspend_work()