Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
51ec005a
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看板
提交
51ec005a
编写于
10月 12, 2015
作者:
R
Rafael J. Wysocki
浏览文件
操作
浏览文件
下载
差异文件
Merge back earlier cpufreq material for v4.4.
上级
55582bcc
d43b1b6f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
74 addition
and
34 deletion
+74
-34
drivers/cpufreq/cpufreq_conservative.c
drivers/cpufreq/cpufreq_conservative.c
+18
-13
drivers/cpufreq/cpufreq_governor.c
drivers/cpufreq/cpufreq_governor.c
+1
-11
drivers/cpufreq/cpufreq_governor.h
drivers/cpufreq/cpufreq_governor.h
+0
-1
drivers/cpufreq/imx6q-cpufreq.c
drivers/cpufreq/imx6q-cpufreq.c
+45
-5
drivers/cpufreq/integrator-cpufreq.c
drivers/cpufreq/integrator-cpufreq.c
+2
-0
drivers/cpufreq/powernv-cpufreq.c
drivers/cpufreq/powernv-cpufreq.c
+8
-2
drivers/cpufreq/tegra20-cpufreq.c
drivers/cpufreq/tegra20-cpufreq.c
+0
-2
未找到文件。
drivers/cpufreq/cpufreq_conservative.c
浏览文件 @
51ec005a
...
...
@@ -23,6 +23,19 @@
static
DEFINE_PER_CPU
(
struct
cs_cpu_dbs_info_s
,
cs_cpu_dbs_info
);
static
int
cs_cpufreq_governor_dbs
(
struct
cpufreq_policy
*
policy
,
unsigned
int
event
);
#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
static
#endif
struct
cpufreq_governor
cpufreq_gov_conservative
=
{
.
name
=
"conservative"
,
.
governor
=
cs_cpufreq_governor_dbs
,
.
max_transition_latency
=
TRANSITION_LATENCY_LIMIT
,
.
owner
=
THIS_MODULE
,
};
static
inline
unsigned
int
get_freq_target
(
struct
cs_dbs_tuners
*
cs_tuners
,
struct
cpufreq_policy
*
policy
)
{
...
...
@@ -119,12 +132,14 @@ static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
struct
cpufreq_freqs
*
freq
=
data
;
struct
cs_cpu_dbs_info_s
*
dbs_info
=
&
per_cpu
(
cs_cpu_dbs_info
,
freq
->
cpu
);
struct
cpufreq_policy
*
policy
;
struct
cpufreq_policy
*
policy
=
cpufreq_cpu_get_raw
(
freq
->
cpu
)
;
if
(
!
dbs_info
->
enable
)
if
(
!
policy
)
return
0
;
policy
=
dbs_info
->
cdbs
.
shared
->
policy
;
/* policy isn't governed by conservative governor */
if
(
policy
->
governor
!=
&
cpufreq_gov_conservative
)
return
0
;
/*
* we only care if our internally tracked freq moves outside the 'valid'
...
...
@@ -367,16 +382,6 @@ static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
return
cpufreq_governor_dbs
(
policy
,
&
cs_dbs_cdata
,
event
);
}
#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
static
#endif
struct
cpufreq_governor
cpufreq_gov_conservative
=
{
.
name
=
"conservative"
,
.
governor
=
cs_cpufreq_governor_dbs
,
.
max_transition_latency
=
TRANSITION_LATENCY_LIMIT
,
.
owner
=
THIS_MODULE
,
};
static
int
__init
cpufreq_gov_dbs_init
(
void
)
{
return
cpufreq_register_governor
(
&
cpufreq_gov_conservative
);
...
...
drivers/cpufreq/cpufreq_governor.c
浏览文件 @
51ec005a
...
...
@@ -463,7 +463,6 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy,
cdata
->
get_cpu_dbs_info_s
(
cpu
);
cs_dbs_info
->
down_skip
=
0
;
cs_dbs_info
->
enable
=
1
;
cs_dbs_info
->
requested_freq
=
policy
->
cur
;
}
else
{
struct
od_ops
*
od_ops
=
cdata
->
gov_ops
;
...
...
@@ -482,9 +481,7 @@ static int cpufreq_governor_start(struct cpufreq_policy *policy,
static
int
cpufreq_governor_stop
(
struct
cpufreq_policy
*
policy
,
struct
dbs_data
*
dbs_data
)
{
struct
common_dbs_data
*
cdata
=
dbs_data
->
cdata
;
unsigned
int
cpu
=
policy
->
cpu
;
struct
cpu_dbs_info
*
cdbs
=
cdata
->
get_cpu_cdbs
(
cpu
);
struct
cpu_dbs_info
*
cdbs
=
dbs_data
->
cdata
->
get_cpu_cdbs
(
policy
->
cpu
);
struct
cpu_common_dbs_info
*
shared
=
cdbs
->
shared
;
/* State should be equivalent to START */
...
...
@@ -493,13 +490,6 @@ static int cpufreq_governor_stop(struct cpufreq_policy *policy,
gov_cancel_work
(
dbs_data
,
policy
);
if
(
cdata
->
governor
==
GOV_CONSERVATIVE
)
{
struct
cs_cpu_dbs_info_s
*
cs_dbs_info
=
cdata
->
get_cpu_dbs_info_s
(
cpu
);
cs_dbs_info
->
enable
=
0
;
}
shared
->
policy
=
NULL
;
mutex_destroy
(
&
shared
->
timer_mutex
);
return
0
;
...
...
drivers/cpufreq/cpufreq_governor.h
浏览文件 @
51ec005a
...
...
@@ -170,7 +170,6 @@ struct cs_cpu_dbs_info_s {
struct
cpu_dbs_info
cdbs
;
unsigned
int
down_skip
;
unsigned
int
requested_freq
;
unsigned
int
enable
:
1
;
};
/* Per policy Governors sysfs tunables */
...
...
drivers/cpufreq/imx6q-cpufreq.c
浏览文件 @
51ec005a
...
...
@@ -30,6 +30,10 @@ static struct clk *pll1_sw_clk;
static
struct
clk
*
step_clk
;
static
struct
clk
*
pll2_pfd2_396m_clk
;
/* clk used by i.MX6UL */
static
struct
clk
*
pll2_bus_clk
;
static
struct
clk
*
secondary_sel_clk
;
static
struct
device
*
cpu_dev
;
static
bool
free_opp
;
static
struct
cpufreq_frequency_table
*
freq_table
;
...
...
@@ -91,16 +95,36 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index)
* The setpoints are selected per PLL/PDF frequencies, so we need to
* reprogram PLL for frequency scaling. The procedure of reprogramming
* PLL1 is as below.
*
* For i.MX6UL, it has a secondary clk mux, the cpu frequency change
* flow is slightly different from other i.MX6 OSC.
* The cpu frequeny change flow for i.MX6(except i.MX6UL) is as below:
* - Enable pll2_pfd2_396m_clk and reparent pll1_sw_clk to it
* - Reprogram pll1_sys_clk and reparent pll1_sw_clk back to it
* - Disable pll2_pfd2_396m_clk
*/
clk_set_parent
(
step_clk
,
pll2_pfd2_396m_clk
);
clk_set_parent
(
pll1_sw_clk
,
step_clk
);
if
(
freq_hz
>
clk_get_rate
(
pll2_pfd2_396m_clk
))
{
clk_set_rate
(
pll1_sys_clk
,
new_freq
*
1000
);
if
(
of_machine_is_compatible
(
"fsl,imx6ul"
))
{
/*
* When changing pll1_sw_clk's parent to pll1_sys_clk,
* CPU may run at higher than 528MHz, this will lead to
* the system unstable if the voltage is lower than the
* voltage of 528MHz, so lower the CPU frequency to one
* half before changing CPU frequency.
*/
clk_set_rate
(
arm_clk
,
(
old_freq
>>
1
)
*
1000
);
clk_set_parent
(
pll1_sw_clk
,
pll1_sys_clk
);
if
(
freq_hz
>
clk_get_rate
(
pll2_pfd2_396m_clk
))
clk_set_parent
(
secondary_sel_clk
,
pll2_bus_clk
);
else
clk_set_parent
(
secondary_sel_clk
,
pll2_pfd2_396m_clk
);
clk_set_parent
(
step_clk
,
secondary_sel_clk
);
clk_set_parent
(
pll1_sw_clk
,
step_clk
);
}
else
{
clk_set_parent
(
step_clk
,
pll2_pfd2_396m_clk
);
clk_set_parent
(
pll1_sw_clk
,
step_clk
);
if
(
freq_hz
>
clk_get_rate
(
pll2_pfd2_396m_clk
))
{
clk_set_rate
(
pll1_sys_clk
,
new_freq
*
1000
);
clk_set_parent
(
pll1_sw_clk
,
pll1_sys_clk
);
}
}
/* Ensure the arm clock divider is what we expect */
...
...
@@ -186,6 +210,16 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
goto
put_clk
;
}
if
(
of_machine_is_compatible
(
"fsl,imx6ul"
))
{
pll2_bus_clk
=
clk_get
(
cpu_dev
,
"pll2_bus"
);
secondary_sel_clk
=
clk_get
(
cpu_dev
,
"secondary_sel"
);
if
(
IS_ERR
(
pll2_bus_clk
)
||
IS_ERR
(
secondary_sel_clk
))
{
dev_err
(
cpu_dev
,
"failed to get clocks specific to imx6ul
\n
"
);
ret
=
-
ENOENT
;
goto
put_clk
;
}
}
arm_reg
=
regulator_get
(
cpu_dev
,
"arm"
);
pu_reg
=
regulator_get_optional
(
cpu_dev
,
"pu"
);
soc_reg
=
regulator_get
(
cpu_dev
,
"soc"
);
...
...
@@ -331,6 +365,10 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
clk_put
(
step_clk
);
if
(
!
IS_ERR
(
pll2_pfd2_396m_clk
))
clk_put
(
pll2_pfd2_396m_clk
);
if
(
!
IS_ERR
(
pll2_bus_clk
))
clk_put
(
pll2_bus_clk
);
if
(
!
IS_ERR
(
secondary_sel_clk
))
clk_put
(
secondary_sel_clk
);
of_node_put
(
np
);
return
ret
;
}
...
...
@@ -350,6 +388,8 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev)
clk_put
(
pll1_sw_clk
);
clk_put
(
step_clk
);
clk_put
(
pll2_pfd2_396m_clk
);
clk_put
(
pll2_bus_clk
);
clk_put
(
secondary_sel_clk
);
return
0
;
}
...
...
drivers/cpufreq/integrator-cpufreq.c
浏览文件 @
51ec005a
...
...
@@ -221,6 +221,8 @@ static const struct of_device_id integrator_cpufreq_match[] = {
{
},
};
MODULE_DEVICE_TABLE
(
of
,
integrator_cpufreq_match
);
static
struct
platform_driver
integrator_cpufreq_driver
=
{
.
driver
=
{
.
name
=
"integrator-cpufreq"
,
...
...
drivers/cpufreq/powernv-cpufreq.c
浏览文件 @
51ec005a
...
...
@@ -327,8 +327,14 @@ static void powernv_cpufreq_throttle_check(void *data)
if
(
chips
[
i
].
throttled
)
goto
next
;
chips
[
i
].
throttled
=
true
;
pr_info
(
"CPU %d on Chip %u has Pmax reduced to %d
\n
"
,
cpu
,
chips
[
i
].
id
,
pmsr_pmax
);
if
(
pmsr_pmax
<
powernv_pstate_info
.
nominal
)
pr_crit
(
"CPU %d on Chip %u has Pmax reduced below nominal frequency (%d < %d)
\n
"
,
cpu
,
chips
[
i
].
id
,
pmsr_pmax
,
powernv_pstate_info
.
nominal
);
else
pr_info
(
"CPU %d on Chip %u has Pmax reduced below turbo frequency (%d < %d)
\n
"
,
cpu
,
chips
[
i
].
id
,
pmsr_pmax
,
powernv_pstate_info
.
max
);
}
else
if
(
chips
[
i
].
throttled
)
{
chips
[
i
].
throttled
=
false
;
pr_info
(
"CPU %d on Chip %u has Pmax restored to %d
\n
"
,
cpu
,
...
...
drivers/cpufreq/tegra20-cpufreq.c
浏览文件 @
51ec005a
...
...
@@ -175,9 +175,7 @@ static struct cpufreq_driver tegra_cpufreq_driver = {
.
exit
=
tegra_cpu_exit
,
.
name
=
"tegra"
,
.
attr
=
cpufreq_generic_attr
,
#ifdef CONFIG_PM
.
suspend
=
cpufreq_generic_suspend
,
#endif
};
static
int
__init
tegra_cpufreq_init
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录