Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
46fa233a
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
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看板
提交
46fa233a
编写于
1月 15, 2018
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge generic power domains (genpd) material for v4.16 into pm-core
上级
0026cef0
17218e00
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
36 deletion
+33
-36
drivers/base/power/domain.c
drivers/base/power/domain.c
+33
-36
未找到文件。
drivers/base/power/domain.c
浏览文件 @
46fa233a
...
...
@@ -1032,15 +1032,12 @@ static int genpd_prepare(struct device *dev)
static
int
genpd_finish_suspend
(
struct
device
*
dev
,
bool
poweroff
)
{
struct
generic_pm_domain
*
genpd
;
int
ret
;
int
ret
=
0
;
genpd
=
dev_to_genpd
(
dev
);
if
(
IS_ERR
(
genpd
))
return
-
EINVAL
;
if
(
dev
->
power
.
wakeup_path
&&
genpd_is_active_wakeup
(
genpd
))
return
0
;
if
(
poweroff
)
ret
=
pm_generic_poweroff_noirq
(
dev
);
else
...
...
@@ -1048,10 +1045,19 @@ static int genpd_finish_suspend(struct device *dev, bool poweroff)
if
(
ret
)
return
ret
;
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
)
{
ret
=
pm_runtime_force_suspend
(
dev
);
if
(
ret
)
if
(
dev
->
power
.
wakeup_path
&&
genpd_is_active_wakeup
(
genpd
))
return
0
;
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
&&
!
pm_runtime_status_suspended
(
dev
))
{
ret
=
genpd_stop_dev
(
genpd
,
dev
);
if
(
ret
)
{
if
(
poweroff
)
pm_generic_restore_noirq
(
dev
);
else
pm_generic_resume_noirq
(
dev
);
return
ret
;
}
}
genpd_lock
(
genpd
);
...
...
@@ -1085,7 +1091,7 @@ static int genpd_suspend_noirq(struct device *dev)
static
int
genpd_resume_noirq
(
struct
device
*
dev
)
{
struct
generic_pm_domain
*
genpd
;
int
ret
=
0
;
int
ret
;
dev_dbg
(
dev
,
"%s()
\n
"
,
__func__
);
...
...
@@ -1094,21 +1100,21 @@ static int genpd_resume_noirq(struct device *dev)
return
-
EINVAL
;
if
(
dev
->
power
.
wakeup_path
&&
genpd_is_active_wakeup
(
genpd
))
return
0
;
return
pm_generic_resume_noirq
(
dev
)
;
genpd_lock
(
genpd
);
genpd_sync_power_on
(
genpd
,
true
,
0
);
genpd
->
suspended_count
--
;
genpd_unlock
(
genpd
);
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
)
ret
=
pm_runtime_force_resume
(
dev
);
ret
=
pm_generic_resume_noirq
(
dev
);
if
(
ret
)
return
ret
;
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
&&
!
pm_runtime_status_suspended
(
dev
))
{
ret
=
genpd_start_dev
(
genpd
,
dev
);
if
(
ret
)
return
ret
;
}
return
ret
;
return
pm_generic_resume_noirq
(
dev
)
;
}
/**
...
...
@@ -1135,8 +1141,9 @@ static int genpd_freeze_noirq(struct device *dev)
if
(
ret
)
return
ret
;
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
)
ret
=
pm_runtime_force_suspend
(
dev
);
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
&&
!
pm_runtime_status_suspended
(
dev
))
ret
=
genpd_stop_dev
(
genpd
,
dev
);
return
ret
;
}
...
...
@@ -1159,8 +1166,9 @@ static int genpd_thaw_noirq(struct device *dev)
if
(
IS_ERR
(
genpd
))
return
-
EINVAL
;
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
)
{
ret
=
pm_runtime_force_resume
(
dev
);
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
&&
!
pm_runtime_status_suspended
(
dev
))
{
ret
=
genpd_start_dev
(
genpd
,
dev
);
if
(
ret
)
return
ret
;
}
...
...
@@ -1217,8 +1225,9 @@ static int genpd_restore_noirq(struct device *dev)
genpd_sync_power_on
(
genpd
,
true
,
0
);
genpd_unlock
(
genpd
);
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
)
{
ret
=
pm_runtime_force_resume
(
dev
);
if
(
genpd
->
dev_ops
.
stop
&&
genpd
->
dev_ops
.
start
&&
!
pm_runtime_status_suspended
(
dev
))
{
ret
=
genpd_start_dev
(
genpd
,
dev
);
if
(
ret
)
return
ret
;
}
...
...
@@ -2199,20 +2208,8 @@ int genpd_dev_pm_attach(struct device *dev)
ret
=
of_parse_phandle_with_args
(
dev
->
of_node
,
"power-domains"
,
"#power-domain-cells"
,
0
,
&
pd_args
);
if
(
ret
<
0
)
{
if
(
ret
!=
-
ENOENT
)
return
ret
;
/*
* Try legacy Samsung-specific bindings
* (for backwards compatibility of DT ABI)
*/
pd_args
.
args_count
=
0
;
pd_args
.
np
=
of_parse_phandle
(
dev
->
of_node
,
"samsung,power-domain"
,
0
);
if
(
!
pd_args
.
np
)
return
-
ENOENT
;
}
if
(
ret
<
0
)
return
ret
;
mutex_lock
(
&
gpd_list_lock
);
pd
=
genpd_get_from_provider
(
&
pd_args
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录