Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9c6a6b3c
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9c6a6b3c
编写于
1月 20, 2010
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'acpi-pad' into release
上级
24bc7347
3b8cb427
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
17 deletion
+20
-17
drivers/acpi/acpi_pad.c
drivers/acpi/acpi_pad.c
+20
-17
未找到文件。
drivers/acpi/acpi_pad.c
浏览文件 @
9c6a6b3c
...
...
@@ -208,7 +208,7 @@ static int power_saving_thread(void *data)
* the mechanism only works when all CPUs have RT task running,
* as if one CPU hasn't RT task, RT task from other CPUs will
* borrow CPU time from this CPU and cause RT task use > 95%
* CPU time. To make 'avoid staration' work, takes a nap here.
* CPU time. To make 'avoid star
v
ation' work, takes a nap here.
*/
if
(
do_sleep
)
schedule_timeout_killable
(
HZ
*
idle_pct
/
100
);
...
...
@@ -222,14 +222,18 @@ static struct task_struct *ps_tsks[NR_CPUS];
static
unsigned
int
ps_tsk_num
;
static
int
create_power_saving_task
(
void
)
{
int
rc
=
-
ENOMEM
;
ps_tsks
[
ps_tsk_num
]
=
kthread_run
(
power_saving_thread
,
(
void
*
)(
unsigned
long
)
ps_tsk_num
,
"power_saving/%d"
,
ps_tsk_num
);
if
(
ps_tsks
[
ps_tsk_num
])
{
rc
=
IS_ERR
(
ps_tsks
[
ps_tsk_num
])
?
PTR_ERR
(
ps_tsks
[
ps_tsk_num
])
:
0
;
if
(
!
rc
)
ps_tsk_num
++
;
return
0
;
}
return
-
EINVAL
;
else
ps_tsks
[
ps_tsk_num
]
=
NULL
;
return
rc
;
}
static
void
destroy_power_saving_task
(
void
)
...
...
@@ -237,6 +241,7 @@ static void destroy_power_saving_task(void)
if
(
ps_tsk_num
>
0
)
{
ps_tsk_num
--
;
kthread_stop
(
ps_tsks
[
ps_tsk_num
]);
ps_tsks
[
ps_tsk_num
]
=
NULL
;
}
}
...
...
@@ -253,7 +258,7 @@ static void set_power_saving_task_num(unsigned int num)
}
}
static
int
acpi_pad_idle_cpus
(
unsigned
int
num_cpus
)
static
void
acpi_pad_idle_cpus
(
unsigned
int
num_cpus
)
{
get_online_cpus
();
...
...
@@ -261,7 +266,6 @@ static int acpi_pad_idle_cpus(unsigned int num_cpus)
set_power_saving_task_num
(
num_cpus
);
put_online_cpus
();
return
0
;
}
static
uint32_t
acpi_pad_idle_cpus_num
(
void
)
...
...
@@ -369,19 +373,21 @@ static void acpi_pad_remove_sysfs(struct acpi_device *device)
static
int
acpi_pad_pur
(
acpi_handle
handle
,
int
*
num_cpus
)
{
struct
acpi_buffer
buffer
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
acpi_status
status
;
union
acpi_object
*
package
;
int
rev
,
num
,
ret
=
-
EINVAL
;
status
=
acpi_evaluate_object
(
handle
,
"_PUR"
,
NULL
,
&
buffer
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
acpi_evaluate_object
(
handle
,
"_PUR"
,
NULL
,
&
buffer
)))
return
-
EINVAL
;
if
(
!
buffer
.
length
||
!
buffer
.
pointer
)
return
-
EINVAL
;
package
=
buffer
.
pointer
;
if
(
package
->
type
!=
ACPI_TYPE_PACKAGE
||
package
->
package
.
count
!=
2
)
goto
out
;
rev
=
package
->
package
.
elements
[
0
].
integer
.
value
;
num
=
package
->
package
.
elements
[
1
].
integer
.
value
;
if
(
rev
!=
1
)
if
(
rev
!=
1
||
num
<
0
)
goto
out
;
*
num_cpus
=
num
;
ret
=
0
;
...
...
@@ -410,7 +416,7 @@ static void acpi_pad_ost(acpi_handle handle, int stat,
static
void
acpi_pad_handle_notify
(
acpi_handle
handle
)
{
int
num_cpus
,
ret
;
int
num_cpus
;
uint32_t
idle_cpus
;
mutex_lock
(
&
isolated_cpus_lock
);
...
...
@@ -418,12 +424,9 @@ static void acpi_pad_handle_notify(acpi_handle handle)
mutex_unlock
(
&
isolated_cpus_lock
);
return
;
}
ret
=
acpi_pad_idle_cpus
(
num_cpus
);
acpi_pad_idle_cpus
(
num_cpus
);
idle_cpus
=
acpi_pad_idle_cpus_num
();
if
(
!
ret
)
acpi_pad_ost
(
handle
,
0
,
idle_cpus
);
else
acpi_pad_ost
(
handle
,
1
,
0
);
acpi_pad_ost
(
handle
,
0
,
idle_cpus
);
mutex_unlock
(
&
isolated_cpus_lock
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录