Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c7a5518a
Commit
c7a5518a
authored
Nov 28, 2022
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge back earlier cpufreq material for v6.2.
parents
1056d314
cab75e1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
43 deletions
+14
-43
drivers/cpufreq/acpi-cpufreq.c
drivers/cpufreq/acpi-cpufreq.c
+6
-36
drivers/cpufreq/intel_pstate.c
drivers/cpufreq/intel_pstate.c
+5
-4
drivers/cpufreq/longhaul.c
drivers/cpufreq/longhaul.c
+2
-2
drivers/cpufreq/spear-cpufreq.c
drivers/cpufreq/spear-cpufreq.c
+1
-1
No files found.
drivers/cpufreq/acpi-cpufreq.c
View file @
c7a5518a
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include <linux/compiler.h>
#include <linux/compiler.h>
#include <linux/dmi.h>
#include <linux/dmi.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/string_helpers.h>
#include <linux/acpi.h>
#include <linux/acpi.h>
#include <linux/io.h>
#include <linux/io.h>
...
@@ -135,8 +136,8 @@ static int set_boost(struct cpufreq_policy *policy, int val)
...
@@ -135,8 +136,8 @@ static int set_boost(struct cpufreq_policy *policy, int val)
{
{
on_each_cpu_mask
(
policy
->
cpus
,
boost_set_msr_each
,
on_each_cpu_mask
(
policy
->
cpus
,
boost_set_msr_each
,
(
void
*
)(
long
)
val
,
1
);
(
void
*
)(
long
)
val
,
1
);
pr_debug
(
"CPU %*pbl: Core Boosting %s
abled
.
\n
"
,
pr_debug
(
"CPU %*pbl: Core Boosting %s.
\n
"
,
cpumask_pr_args
(
policy
->
cpus
),
val
?
"en"
:
"dis"
);
cpumask_pr_args
(
policy
->
cpus
),
str_enabled_disabled
(
val
)
);
return
0
;
return
0
;
}
}
...
@@ -535,15 +536,6 @@ static void free_acpi_perf_data(void)
...
@@ -535,15 +536,6 @@ static void free_acpi_perf_data(void)
free_percpu
(
acpi_perf_data
);
free_percpu
(
acpi_perf_data
);
}
}
static
int
cpufreq_boost_online
(
unsigned
int
cpu
)
{
/*
* On the CPU_UP path we simply keep the boost-disable flag
* in sync with the current global state.
*/
return
boost_set_msr
(
acpi_cpufreq_driver
.
boost_enabled
);
}
static
int
cpufreq_boost_down_prep
(
unsigned
int
cpu
)
static
int
cpufreq_boost_down_prep
(
unsigned
int
cpu
)
{
{
/*
/*
...
@@ -897,6 +889,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
...
@@ -897,6 +889,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
if
(
perf
->
states
[
0
].
core_frequency
*
1000
!=
freq_table
[
0
].
frequency
)
if
(
perf
->
states
[
0
].
core_frequency
*
1000
!=
freq_table
[
0
].
frequency
)
pr_warn
(
FW_WARN
"P-state 0 is not max freq
\n
"
);
pr_warn
(
FW_WARN
"P-state 0 is not max freq
\n
"
);
set_boost
(
policy
,
acpi_cpufreq_driver
.
boost_enabled
);
return
result
;
return
result
;
err_unreg:
err_unreg:
...
@@ -916,6 +910,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
...
@@ -916,6 +910,7 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
pr_debug
(
"%s
\n
"
,
__func__
);
pr_debug
(
"%s
\n
"
,
__func__
);
cpufreq_boost_down_prep
(
policy
->
cpu
);
policy
->
fast_switch_possible
=
false
;
policy
->
fast_switch_possible
=
false
;
policy
->
driver_data
=
NULL
;
policy
->
driver_data
=
NULL
;
acpi_processor_unregister_performance
(
data
->
acpi_perf_cpu
);
acpi_processor_unregister_performance
(
data
->
acpi_perf_cpu
);
...
@@ -958,12 +953,8 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
...
@@ -958,12 +953,8 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
.
attr
=
acpi_cpufreq_attr
,
.
attr
=
acpi_cpufreq_attr
,
};
};
static
enum
cpuhp_state
acpi_cpufreq_online
;
static
void
__init
acpi_cpufreq_boost_init
(
void
)
static
void
__init
acpi_cpufreq_boost_init
(
void
)
{
{
int
ret
;
if
(
!
(
boot_cpu_has
(
X86_FEATURE_CPB
)
||
boot_cpu_has
(
X86_FEATURE_IDA
)))
{
if
(
!
(
boot_cpu_has
(
X86_FEATURE_CPB
)
||
boot_cpu_has
(
X86_FEATURE_IDA
)))
{
pr_debug
(
"Boost capabilities not present in the processor
\n
"
);
pr_debug
(
"Boost capabilities not present in the processor
\n
"
);
return
;
return
;
...
@@ -971,24 +962,6 @@ static void __init acpi_cpufreq_boost_init(void)
...
@@ -971,24 +962,6 @@ static void __init acpi_cpufreq_boost_init(void)
acpi_cpufreq_driver
.
set_boost
=
set_boost
;
acpi_cpufreq_driver
.
set_boost
=
set_boost
;
acpi_cpufreq_driver
.
boost_enabled
=
boost_state
(
0
);
acpi_cpufreq_driver
.
boost_enabled
=
boost_state
(
0
);
/*
* This calls the online callback on all online cpu and forces all
* MSRs to the same value.
*/
ret
=
cpuhp_setup_state
(
CPUHP_AP_ONLINE_DYN
,
"cpufreq/acpi:online"
,
cpufreq_boost_online
,
cpufreq_boost_down_prep
);
if
(
ret
<
0
)
{
pr_err
(
"acpi_cpufreq: failed to register hotplug callbacks
\n
"
);
return
;
}
acpi_cpufreq_online
=
ret
;
}
static
void
acpi_cpufreq_boost_exit
(
void
)
{
if
(
acpi_cpufreq_online
>
0
)
cpuhp_remove_state_nocalls
(
acpi_cpufreq_online
);
}
}
static
int
__init
acpi_cpufreq_init
(
void
)
static
int
__init
acpi_cpufreq_init
(
void
)
...
@@ -1032,7 +1005,6 @@ static int __init acpi_cpufreq_init(void)
...
@@ -1032,7 +1005,6 @@ static int __init acpi_cpufreq_init(void)
ret
=
cpufreq_register_driver
(
&
acpi_cpufreq_driver
);
ret
=
cpufreq_register_driver
(
&
acpi_cpufreq_driver
);
if
(
ret
)
{
if
(
ret
)
{
free_acpi_perf_data
();
free_acpi_perf_data
();
acpi_cpufreq_boost_exit
();
}
}
return
ret
;
return
ret
;
}
}
...
@@ -1041,8 +1013,6 @@ static void __exit acpi_cpufreq_exit(void)
...
@@ -1041,8 +1013,6 @@ static void __exit acpi_cpufreq_exit(void)
{
{
pr_debug
(
"%s
\n
"
,
__func__
);
pr_debug
(
"%s
\n
"
,
__func__
);
acpi_cpufreq_boost_exit
();
cpufreq_unregister_driver
(
&
acpi_cpufreq_driver
);
cpufreq_unregister_driver
(
&
acpi_cpufreq_driver
);
free_acpi_perf_data
();
free_acpi_perf_data
();
...
...
drivers/cpufreq/intel_pstate.c
View file @
c7a5518a
...
@@ -298,6 +298,7 @@ static int hwp_active __read_mostly;
...
@@ -298,6 +298,7 @@ static int hwp_active __read_mostly;
static
int
hwp_mode_bdw
__read_mostly
;
static
int
hwp_mode_bdw
__read_mostly
;
static
bool
per_cpu_limits
__read_mostly
;
static
bool
per_cpu_limits
__read_mostly
;
static
bool
hwp_boost
__read_mostly
;
static
bool
hwp_boost
__read_mostly
;
static
bool
hwp_forced
__read_mostly
;
static
struct
cpufreq_driver
*
intel_pstate_driver
__read_mostly
;
static
struct
cpufreq_driver
*
intel_pstate_driver
__read_mostly
;
...
@@ -1679,12 +1680,12 @@ static void intel_pstate_update_epp_defaults(struct cpudata *cpudata)
...
@@ -1679,12 +1680,12 @@ static void intel_pstate_update_epp_defaults(struct cpudata *cpudata)
return
;
return
;
/*
/*
* If
powerup EPP is something other than chipset default 0x80 and
* If
the EPP is set by firmware, which means that firmware enabled HWP
* -
is more performance oriented
than 0x80 (default balance_perf EPP)
* -
Is equal or less
than 0x80 (default balance_perf EPP)
* - But less performance oriented than performance EPP
* - But less performance oriented than performance EPP
* then use this as new balance_perf EPP.
* then use this as new balance_perf EPP.
*/
*/
if
(
cpudata
->
epp_default
<
HWP_EPP_BALANCE_PERFORMANCE
&&
if
(
hwp_forced
&&
cpudata
->
epp_default
<=
HWP_EPP_BALANCE_PERFORMANCE
&&
cpudata
->
epp_default
>
HWP_EPP_PERFORMANCE
)
{
cpudata
->
epp_default
>
HWP_EPP_PERFORMANCE
)
{
epp_values
[
EPP_INDEX_BALANCE_PERFORMANCE
]
=
cpudata
->
epp_default
;
epp_values
[
EPP_INDEX_BALANCE_PERFORMANCE
]
=
cpudata
->
epp_default
;
return
;
return
;
...
@@ -3384,7 +3385,7 @@ static int __init intel_pstate_init(void)
...
@@ -3384,7 +3385,7 @@ static int __init intel_pstate_init(void)
id
=
x86_match_cpu
(
hwp_support_ids
);
id
=
x86_match_cpu
(
hwp_support_ids
);
if
(
id
)
{
if
(
id
)
{
bool
hwp_forced
=
intel_pstate_hwp_is_enabled
();
hwp_forced
=
intel_pstate_hwp_is_enabled
();
if
(
hwp_forced
)
if
(
hwp_forced
)
pr_info
(
"HWP enabled by BIOS
\n
"
);
pr_info
(
"HWP enabled by BIOS
\n
"
);
...
...
drivers/cpufreq/longhaul.c
View file @
c7a5518a
...
@@ -407,10 +407,10 @@ static int guess_fsb(int mult)
...
@@ -407,10 +407,10 @@ static int guess_fsb(int mult)
{
{
int
speed
=
cpu_khz
/
1000
;
int
speed
=
cpu_khz
/
1000
;
int
i
;
int
i
;
int
speeds
[]
=
{
666
,
1000
,
1333
,
2000
};
static
const
int
speeds
[]
=
{
666
,
1000
,
1333
,
2000
};
int
f_max
,
f_min
;
int
f_max
,
f_min
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
speeds
)
;
i
++
)
{
f_max
=
((
speeds
[
i
]
*
mult
)
+
50
)
/
100
;
f_max
=
((
speeds
[
i
]
*
mult
)
+
50
)
/
100
;
f_max
+=
(
ROUNDING
/
2
);
f_max
+=
(
ROUNDING
/
2
);
f_min
=
f_max
-
ROUNDING
;
f_min
=
f_max
-
ROUNDING
;
...
...
drivers/cpufreq/spear-cpufreq.c
View file @
c7a5518a
...
@@ -39,7 +39,7 @@ static struct clk *spear1340_cpu_get_possible_parent(unsigned long newfreq)
...
@@ -39,7 +39,7 @@ static struct clk *spear1340_cpu_get_possible_parent(unsigned long newfreq)
* In SPEAr1340, cpu clk's parent sys clk can take input from
* In SPEAr1340, cpu clk's parent sys clk can take input from
* following sources
* following sources
*/
*/
const
char
*
sys_clk_src
[]
=
{
static
const
char
*
const
sys_clk_src
[]
=
{
"sys_syn_clk"
,
"sys_syn_clk"
,
"pll1_clk"
,
"pll1_clk"
,
"pll2_clk"
,
"pll2_clk"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment