Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:test_suspend

Proto:static int __init test_suspend(void)

Type:int

Parameter:Nothing

181  static char warn_no_rtc[] __initdata = warning conditions  "PM: no wakealarm-capable RTC driver is ready\n"
184  struct rtc_device * rtc = NULL
189  If Not Kernel options like "test_suspend=mem" force suspend/resume sanity tests* at startup time. They're normally disabled, for faster boot and because* we can't know which states really work on this particular system. Then Return 0
192  When test_state < PM_SUSPEND_MAX cycle
193  state_label = pm_states[test_state]
195  If state_label && Not strcmp(Kernel options like "test_suspend=mem" force suspend/resume sanity tests* at startup time. They're normally disabled, for faster boot and because* we can't know which states really work on this particular system., state_label) Then Break
198  If test_state == PM_SUSPEND_MAX Then
199  printk(warn_bad_state, Kernel options like "test_suspend=mem" force suspend/resume sanity tests* at startup time. They're normally disabled, for faster boot and because* we can't know which states really work on this particular system.)
200  Return 0
204  dev = class_find_device(rtc_class, NULL, NULL, has_wakealarm)
205  If dev Then
206  rtc = rtc_class_open(dev_name(dev))
207  put_device(dev)
209  If Not rtc Then
210  printk(warn_no_rtc)
211  Return 0
215  To test system suspend, we need a hands-off mechanism to resume the* system. RTCs wake alarms are a common self-contained mechanism.
216  rtc_class_close(rtc)
217  Return 0