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
dad2ad82
Commit
dad2ad82
authored
Nov 07, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
parents
7079060f
b7fb358c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
41 deletions
+29
-41
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+1
-2
arch/i386/kernel/cpu/cpufreq/powernow-k7.c
arch/i386/kernel/cpu/cpufreq/powernow-k7.c
+3
-9
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+3
-16
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
+1
-2
drivers/cpufreq/cpufreq.c
drivers/cpufreq/cpufreq.c
+1
-2
drivers/cpufreq/cpufreq_ondemand.c
drivers/cpufreq/cpufreq_ondemand.c
+12
-6
drivers/cpufreq/cpufreq_stats.c
drivers/cpufreq/cpufreq_stats.c
+8
-4
No files found.
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
View file @
dad2ad82
...
...
@@ -377,10 +377,9 @@ acpi_cpufreq_cpu_init (
arg0
.
buffer
.
length
=
12
;
arg0
.
buffer
.
pointer
=
(
u8
*
)
arg0_buf
;
data
=
k
m
alloc
(
sizeof
(
struct
cpufreq_acpi_io
),
GFP_KERNEL
);
data
=
k
z
alloc
(
sizeof
(
struct
cpufreq_acpi_io
),
GFP_KERNEL
);
if
(
!
data
)
return
(
-
ENOMEM
);
memset
(
data
,
0
,
sizeof
(
struct
cpufreq_acpi_io
));
acpi_io_data
[
cpu
]
=
data
;
...
...
arch/i386/kernel/cpu/cpufreq/powernow-k7.c
View file @
dad2ad82
...
...
@@ -171,10 +171,9 @@ static int get_ranges (unsigned char *pst)
unsigned
int
speed
;
u8
fid
,
vid
;
powernow_table
=
k
m
alloc
((
sizeof
(
struct
cpufreq_frequency_table
)
*
(
number_scales
+
1
)),
GFP_KERNEL
);
powernow_table
=
k
z
alloc
((
sizeof
(
struct
cpufreq_frequency_table
)
*
(
number_scales
+
1
)),
GFP_KERNEL
);
if
(
!
powernow_table
)
return
-
ENOMEM
;
memset
(
powernow_table
,
0
,
(
sizeof
(
struct
cpufreq_frequency_table
)
*
(
number_scales
+
1
)));
for
(
j
=
0
;
j
<
number_scales
;
j
++
)
{
fid
=
*
pst
++
;
...
...
@@ -305,16 +304,13 @@ static int powernow_acpi_init(void)
goto
err0
;
}
acpi_processor_perf
=
k
m
alloc
(
sizeof
(
struct
acpi_processor_performance
),
acpi_processor_perf
=
k
z
alloc
(
sizeof
(
struct
acpi_processor_performance
),
GFP_KERNEL
);
if
(
!
acpi_processor_perf
)
{
retval
=
-
ENOMEM
;
goto
err0
;
}
memset
(
acpi_processor_perf
,
0
,
sizeof
(
struct
acpi_processor_performance
));
if
(
acpi_processor_register_performance
(
acpi_processor_perf
,
0
))
{
retval
=
-
EIO
;
goto
err1
;
...
...
@@ -337,14 +333,12 @@ static int powernow_acpi_init(void)
goto
err2
;
}
powernow_table
=
k
m
alloc
((
number_scales
+
1
)
*
(
sizeof
(
struct
cpufreq_frequency_table
)),
GFP_KERNEL
);
powernow_table
=
k
z
alloc
((
number_scales
+
1
)
*
(
sizeof
(
struct
cpufreq_frequency_table
)),
GFP_KERNEL
);
if
(
!
powernow_table
)
{
retval
=
-
ENOMEM
;
goto
err2
;
}
memset
(
powernow_table
,
0
,
((
number_scales
+
1
)
*
sizeof
(
struct
cpufreq_frequency_table
)));
pc
.
val
=
(
unsigned
long
)
acpi_processor_perf
->
states
[
0
].
control
;
for
(
i
=
0
;
i
<
number_scales
;
i
++
)
{
u8
fid
,
vid
;
...
...
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
View file @
dad2ad82
...
...
@@ -462,7 +462,6 @@ static int check_supported_cpu(unsigned int cpu)
oldmask
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
cpu
));
schedule
();
if
(
smp_processor_id
()
!=
cpu
)
{
printk
(
KERN_ERR
"limiting to cpu %u failed
\n
"
,
cpu
);
...
...
@@ -497,9 +496,7 @@ static int check_supported_cpu(unsigned int cpu)
out:
set_cpus_allowed
(
current
,
oldmask
);
schedule
();
return
rc
;
}
static
int
check_pst_table
(
struct
powernow_k8_data
*
data
,
struct
pst_s
*
pst
,
u8
maxvid
)
...
...
@@ -913,7 +910,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
/* only run on specific CPU from here on */
oldmask
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
pol
->
cpu
));
schedule
();
if
(
smp_processor_id
()
!=
pol
->
cpu
)
{
printk
(
KERN_ERR
"limiting to cpu %u failed
\n
"
,
pol
->
cpu
);
...
...
@@ -968,8 +964,6 @@ static int powernowk8_target(struct cpufreq_policy *pol, unsigned targfreq, unsi
err_out:
set_cpus_allowed
(
current
,
oldmask
);
schedule
();
return
ret
;
}
...
...
@@ -991,12 +985,11 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
if
(
!
check_supported_cpu
(
pol
->
cpu
))
return
-
ENODEV
;
data
=
k
m
alloc
(
sizeof
(
struct
powernow_k8_data
),
GFP_KERNEL
);
data
=
k
z
alloc
(
sizeof
(
struct
powernow_k8_data
),
GFP_KERNEL
);
if
(
!
data
)
{
printk
(
KERN_ERR
PFX
"unable to alloc powernow_k8_data"
);
return
-
ENOMEM
;
}
memset
(
data
,
0
,
sizeof
(
struct
powernow_k8_data
));
data
->
cpu
=
pol
->
cpu
;
...
...
@@ -1026,7 +1019,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
/* only run on specific CPU from here on */
oldmask
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
pol
->
cpu
));
schedule
();
if
(
smp_processor_id
()
!=
pol
->
cpu
)
{
printk
(
KERN_ERR
"limiting to cpu %u failed
\n
"
,
pol
->
cpu
);
...
...
@@ -1045,7 +1037,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
/* run on any CPU again */
set_cpus_allowed
(
current
,
oldmask
);
schedule
();
pol
->
governor
=
CPUFREQ_DEFAULT_GOVERNOR
;
pol
->
cpus
=
cpu_core_map
[
pol
->
cpu
];
...
...
@@ -1080,7 +1071,6 @@ static int __init powernowk8_cpu_init(struct cpufreq_policy *pol)
err_out:
set_cpus_allowed
(
current
,
oldmask
);
schedule
();
powernow_k8_cpu_exit_acpi
(
data
);
kfree
(
data
);
...
...
@@ -1116,17 +1106,14 @@ static unsigned int powernowk8_get (unsigned int cpu)
set_cpus_allowed
(
current
,
oldmask
);
return
0
;
}
preempt_disable
();
if
(
query_current_values_with_pending_wait
(
data
))
goto
out
;
khz
=
find_khz_freq_from_fid
(
data
->
currfid
);
out:
preempt_enable_no_resched
();
out:
set_cpus_allowed
(
current
,
oldmask
);
return
khz
;
}
...
...
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
View file @
dad2ad82
...
...
@@ -423,12 +423,11 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
}
}
centrino_model
[
cpu
]
=
k
m
alloc
(
sizeof
(
struct
cpu_model
),
GFP_KERNEL
);
centrino_model
[
cpu
]
=
k
z
alloc
(
sizeof
(
struct
cpu_model
),
GFP_KERNEL
);
if
(
!
centrino_model
[
cpu
])
{
result
=
-
ENOMEM
;
goto
err_unreg
;
}
memset
(
centrino_model
[
cpu
],
0
,
sizeof
(
struct
cpu_model
));
centrino_model
[
cpu
]
->
model_name
=
NULL
;
centrino_model
[
cpu
]
->
max_freq
=
p
.
states
[
0
].
core_frequency
*
1000
;
...
...
drivers/cpufreq/cpufreq.c
View file @
dad2ad82
...
...
@@ -593,12 +593,11 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
goto
module_out
;
}
policy
=
k
m
alloc
(
sizeof
(
struct
cpufreq_policy
),
GFP_KERNEL
);
policy
=
k
z
alloc
(
sizeof
(
struct
cpufreq_policy
),
GFP_KERNEL
);
if
(
!
policy
)
{
ret
=
-
ENOMEM
;
goto
nomem_out
;
}
memset
(
policy
,
0
,
sizeof
(
struct
cpufreq_policy
));
policy
->
cpu
=
cpu
;
policy
->
cpus
=
cpumask_of_cpu
(
cpu
);
...
...
drivers/cpufreq/cpufreq_ondemand.c
View file @
dad2ad82
...
...
@@ -48,7 +48,10 @@
* All times here are in uS.
*/
static
unsigned
int
def_sampling_rate
;
#define MIN_SAMPLING_RATE (def_sampling_rate / 2)
#define MIN_SAMPLING_RATE_RATIO (2)
/* for correct statistics, we need at least 10 ticks between each measure */
#define MIN_STAT_SAMPLING_RATE (MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10))
#define MIN_SAMPLING_RATE (def_sampling_rate / MIN_SAMPLING_RATE_RATIO)
#define MAX_SAMPLING_RATE (500 * def_sampling_rate)
#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)
#define DEF_SAMPLING_DOWN_FACTOR (1)
...
...
@@ -416,13 +419,16 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
if
(
dbs_enable
==
1
)
{
unsigned
int
latency
;
/* policy latency is in nS. Convert it to uS first */
latency
=
policy
->
cpuinfo
.
transition_latency
/
1000
;
if
(
latency
==
0
)
latency
=
1
;
latency
=
policy
->
cpuinfo
.
transition_latency
;
if
(
latency
<
1000
)
latency
=
1000
;
def_sampling_rate
=
(
latency
/
1000
)
*
def_sampling_rate
=
latency
*
DEF_SAMPLING_RATE_LATENCY_MULTIPLIER
;
if
(
def_sampling_rate
<
MIN_STAT_SAMPLING_RATE
)
def_sampling_rate
=
MIN_STAT_SAMPLING_RATE
;
dbs_tuners_ins
.
sampling_rate
=
def_sampling_rate
;
dbs_tuners_ins
.
ignore_nice
=
0
;
...
...
drivers/cpufreq/cpufreq_stats.c
View file @
dad2ad82
...
...
@@ -193,11 +193,15 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
unsigned
int
cpu
=
policy
->
cpu
;
if
(
cpufreq_stats_table
[
cpu
])
return
-
EBUSY
;
if
((
stat
=
k
m
alloc
(
sizeof
(
struct
cpufreq_stats
),
GFP_KERNEL
))
==
NULL
)
if
((
stat
=
k
z
alloc
(
sizeof
(
struct
cpufreq_stats
),
GFP_KERNEL
))
==
NULL
)
return
-
ENOMEM
;
memset
(
stat
,
0
,
sizeof
(
struct
cpufreq_stats
));
data
=
cpufreq_cpu_get
(
cpu
);
if
(
data
==
NULL
)
{
ret
=
-
EINVAL
;
goto
error_get_fail
;
}
if
((
ret
=
sysfs_create_group
(
&
data
->
kobj
,
&
stats_attr_group
)))
goto
error_out
;
...
...
@@ -217,12 +221,11 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
alloc_size
+=
count
*
count
*
sizeof
(
int
);
#endif
stat
->
max_state
=
count
;
stat
->
time_in_state
=
k
m
alloc
(
alloc_size
,
GFP_KERNEL
);
stat
->
time_in_state
=
k
z
alloc
(
alloc_size
,
GFP_KERNEL
);
if
(
!
stat
->
time_in_state
)
{
ret
=
-
ENOMEM
;
goto
error_out
;
}
memset
(
stat
->
time_in_state
,
0
,
alloc_size
);
stat
->
freq_table
=
(
unsigned
int
*
)(
stat
->
time_in_state
+
count
);
#ifdef CONFIG_CPU_FREQ_STAT_DETAILS
...
...
@@ -245,6 +248,7 @@ cpufreq_stats_create_table (struct cpufreq_policy *policy,
return
0
;
error_out:
cpufreq_cpu_put
(
data
);
error_get_fail:
kfree
(
stat
);
cpufreq_stats_table
[
cpu
]
=
NULL
;
return
ret
;
...
...
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