Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
905563ff
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
905563ff
编写于
9月 29, 2014
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge back earlier 'pm-sleep' material for v3.18.
上级
fe82dcec
0cadc702
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
50 addition
and
18 deletion
+50
-18
Documentation/kernel-parameters.txt
Documentation/kernel-parameters.txt
+6
-4
drivers/base/power/sysfs.c
drivers/base/power/sysfs.c
+13
-11
kernel/power/suspend.c
kernel/power/suspend.c
+2
-0
kernel/power/suspend_test.c
kernel/power/suspend_test.c
+29
-3
未找到文件。
Documentation/kernel-parameters.txt
浏览文件 @
905563ff
...
...
@@ -3303,11 +3303,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
tdfx= [HW,DRM]
test_suspend= [SUSPEND]
test_suspend= [SUSPEND]
[,N]
Specify "mem" (for Suspend-to-RAM) or "standby" (for
standby suspend) as the system sleep state to briefly
enter during system startup. The system is woken from
this state using a wakeup-capable RTC alarm.
standby suspend) or "freeze" (for suspend type freeze)
as the system sleep state during system startup with
the optional capability to repeat N number of times.
The system is woken from this state using a
wakeup-capable RTC alarm.
thash_entries= [KNL,NET]
Set number of hash buckets for TCP connection
...
...
drivers/base/power/sysfs.c
浏览文件 @
905563ff
...
...
@@ -92,9 +92,6 @@
* wakeup_count - Report the number of wakeup events related to the device
*/
static
const
char
enabled
[]
=
"enabled"
;
static
const
char
disabled
[]
=
"disabled"
;
const
char
power_group_name
[]
=
"power"
;
EXPORT_SYMBOL_GPL
(
power_group_name
);
...
...
@@ -336,11 +333,14 @@ static DEVICE_ATTR(pm_qos_remote_wakeup, 0644,
#endif
/* CONFIG_PM_RUNTIME */
#ifdef CONFIG_PM_SLEEP
static
const
char
_enabled
[]
=
"enabled"
;
static
const
char
_disabled
[]
=
"disabled"
;
static
ssize_t
wake_show
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
char
*
buf
)
{
return
sprintf
(
buf
,
"%s
\n
"
,
device_can_wakeup
(
dev
)
?
(
device_may_wakeup
(
dev
)
?
enabled
:
disabled
)
?
(
device_may_wakeup
(
dev
)
?
_enabled
:
_
disabled
)
:
""
);
}
...
...
@@ -357,11 +357,11 @@ wake_store(struct device * dev, struct device_attribute *attr,
cp
=
memchr
(
buf
,
'\n'
,
n
);
if
(
cp
)
len
=
cp
-
buf
;
if
(
len
==
sizeof
enabled
-
1
&&
strncmp
(
buf
,
enabled
,
sizeof
enabled
-
1
)
==
0
)
if
(
len
==
sizeof
_
enabled
-
1
&&
strncmp
(
buf
,
_enabled
,
sizeof
_
enabled
-
1
)
==
0
)
device_set_wakeup_enable
(
dev
,
1
);
else
if
(
len
==
sizeof
disabled
-
1
&&
strncmp
(
buf
,
disabled
,
sizeof
disabled
-
1
)
==
0
)
else
if
(
len
==
sizeof
_
disabled
-
1
&&
strncmp
(
buf
,
_disabled
,
sizeof
_
disabled
-
1
)
==
0
)
device_set_wakeup_enable
(
dev
,
0
);
else
return
-
EINVAL
;
...
...
@@ -570,7 +570,8 @@ static ssize_t async_show(struct device *dev, struct device_attribute *attr,
char
*
buf
)
{
return
sprintf
(
buf
,
"%s
\n
"
,
device_async_suspend_enabled
(
dev
)
?
enabled
:
disabled
);
device_async_suspend_enabled
(
dev
)
?
_enabled
:
_disabled
);
}
static
ssize_t
async_store
(
struct
device
*
dev
,
struct
device_attribute
*
attr
,
...
...
@@ -582,9 +583,10 @@ static ssize_t async_store(struct device *dev, struct device_attribute *attr,
cp
=
memchr
(
buf
,
'\n'
,
n
);
if
(
cp
)
len
=
cp
-
buf
;
if
(
len
==
sizeof
enabled
-
1
&&
strncmp
(
buf
,
enabled
,
len
)
==
0
)
if
(
len
==
sizeof
_enabled
-
1
&&
strncmp
(
buf
,
_
enabled
,
len
)
==
0
)
device_enable_async_suspend
(
dev
);
else
if
(
len
==
sizeof
disabled
-
1
&&
strncmp
(
buf
,
disabled
,
len
)
==
0
)
else
if
(
len
==
sizeof
_disabled
-
1
&&
strncmp
(
buf
,
_disabled
,
len
)
==
0
)
device_disable_async_suspend
(
dev
);
else
return
-
EINVAL
;
...
...
kernel/power/suspend.c
浏览文件 @
905563ff
...
...
@@ -361,7 +361,9 @@ int suspend_devices_and_enter(suspend_state_t state)
suspend_test_start
();
dpm_resume_end
(
PMSG_RESUME
);
suspend_test_finish
(
"resume devices"
);
trace_suspend_resume
(
TPS
(
"resume_console"
),
state
,
true
);
resume_console
();
trace_suspend_resume
(
TPS
(
"resume_console"
),
state
,
false
);
Close:
platform_suspend_end
(
state
);
...
...
kernel/power/suspend_test.c
浏览文件 @
905563ff
...
...
@@ -22,6 +22,8 @@
#define TEST_SUSPEND_SECONDS 10
static
unsigned
long
suspend_test_start_time
;
static
u32
test_repeat_count_max
=
1
;
static
u32
test_repeat_count_current
;
void
suspend_test_start
(
void
)
{
...
...
@@ -74,6 +76,7 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
int
status
;
/* this may fail if the RTC hasn't been initialized */
repeat:
status
=
rtc_read_time
(
rtc
,
&
alm
.
time
);
if
(
status
<
0
)
{
printk
(
err_readtime
,
dev_name
(
&
rtc
->
dev
),
status
);
...
...
@@ -100,10 +103,21 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
if
(
state
==
PM_SUSPEND_STANDBY
)
{
printk
(
info_test
,
pm_states
[
state
]);
status
=
pm_suspend
(
state
);
if
(
status
<
0
)
state
=
PM_SUSPEND_FREEZE
;
}
if
(
state
==
PM_SUSPEND_FREEZE
)
{
printk
(
info_test
,
pm_states
[
state
]);
status
=
pm_suspend
(
state
);
}
if
(
status
<
0
)
printk
(
err_suspend
,
status
);
test_repeat_count_current
++
;
if
(
test_repeat_count_current
<
test_repeat_count_max
)
goto
repeat
;
/* Some platforms can't detect that the alarm triggered the
* wakeup, or (accordingly) disable it after it afterwards.
* It's supposed to give oneshot behavior; cope.
...
...
@@ -137,16 +151,28 @@ static char warn_bad_state[] __initdata =
static
int
__init
setup_test_suspend
(
char
*
value
)
{
int
i
;
char
*
repeat
;
char
*
suspend_type
;
/*
"=mem" ==> "mem
" */
/*
example : "=mem[,N]" ==> "mem[,N]
" */
value
++
;
suspend_type
=
strsep
(
&
value
,
","
);
if
(
!
suspend_type
)
return
0
;
repeat
=
strsep
(
&
value
,
","
);
if
(
repeat
)
{
if
(
kstrtou32
(
repeat
,
0
,
&
test_repeat_count_max
))
return
0
;
}
for
(
i
=
0
;
pm_labels
[
i
];
i
++
)
if
(
!
strcmp
(
pm_labels
[
i
],
valu
e
))
{
if
(
!
strcmp
(
pm_labels
[
i
],
suspend_typ
e
))
{
test_state_label
=
pm_labels
[
i
];
return
0
;
}
printk
(
warn_bad_state
,
valu
e
);
printk
(
warn_bad_state
,
suspend_typ
e
);
return
0
;
}
__setup
(
"test_suspend"
,
setup_test_suspend
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录