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
nexedi
linux
Commits
a57920a2
Commit
a57920a2
authored
Jan 08, 2003
by
Andy Grover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpufreq-ACPI: no longer use CPUFREQ_ALL_CPUS (Dominik Brodowski)
parent
bbbb9973
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
50 deletions
+13
-50
drivers/acpi/processor.c
drivers/acpi/processor.c
+13
-50
No files found.
drivers/acpi/processor.c
View file @
a57920a2
...
@@ -1658,7 +1658,6 @@ static int
...
@@ -1658,7 +1658,6 @@ static int
acpi_cpufreq_setpolicy
(
acpi_cpufreq_setpolicy
(
struct
cpufreq_policy
*
policy
)
struct
cpufreq_policy
*
policy
)
{
{
unsigned
int
cpu
=
0
;
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
struct
acpi_processor
*
pr
=
NULL
;
struct
acpi_processor
*
pr
=
NULL
;
unsigned
int
next_state
=
0
;
unsigned
int
next_state
=
0
;
...
@@ -1669,24 +1668,9 @@ acpi_cpufreq_setpolicy (
...
@@ -1669,24 +1668,9 @@ acpi_cpufreq_setpolicy (
if
(
!
policy
)
if
(
!
policy
)
return_VALUE
(
-
EINVAL
);
return_VALUE
(
-
EINVAL
);
/* get a present, initialized CPU */
pr
=
processors
[
policy
->
cpu
];
if
(
policy
->
cpu
==
CPUFREQ_ALL_CPUS
)
if
(
!
pr
)
{
return_VALUE
(
-
EINVAL
);
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
{
if
(
processors
[
i
]
!=
NULL
)
{
cpu
=
i
;
pr
=
processors
[
cpu
];
break
;
}
}
}
else
{
cpu
=
policy
->
cpu
;
pr
=
processors
[
cpu
];
if
(
!
pr
)
return_VALUE
(
-
EINVAL
);
}
/* select appropriate P-State */
/* select appropriate P-State */
if
(
policy
->
policy
==
CPUFREQ_POLICY_POWERSAVE
)
if
(
policy
->
policy
==
CPUFREQ_POLICY_POWERSAVE
)
...
@@ -1715,19 +1699,9 @@ acpi_cpufreq_setpolicy (
...
@@ -1715,19 +1699,9 @@ acpi_cpufreq_setpolicy (
}
}
/* set one or all CPUs to the new state */
/* set one or all CPUs to the new state */
if
(
policy
->
cpu
==
CPUFREQ_ALL_CPUS
)
{
result
=
acpi_processor_set_performance
(
pr
,
next_state
);
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
{
pr
=
processors
[
cpu
];
if
(
!
pr
||
!
cpu_online
(
cpu
))
continue
;
result
=
acpi_processor_set_performance
(
pr
,
next_state
);
}
}
else
{
result
=
acpi_processor_set_performance
(
pr
,
next_state
);
}
return_VALUE
(
0
);
return_VALUE
(
result
);
}
}
...
@@ -1735,7 +1709,6 @@ static int
...
@@ -1735,7 +1709,6 @@ static int
acpi_cpufreq_verify
(
acpi_cpufreq_verify
(
struct
cpufreq_policy
*
policy
)
struct
cpufreq_policy
*
policy
)
{
{
unsigned
int
cpu
=
0
;
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
struct
acpi_processor
*
pr
=
NULL
;
struct
acpi_processor
*
pr
=
NULL
;
unsigned
int
number_states
=
0
;
unsigned
int
number_states
=
0
;
...
@@ -1746,24 +1719,9 @@ acpi_cpufreq_verify (
...
@@ -1746,24 +1719,9 @@ acpi_cpufreq_verify (
if
(
!
policy
)
if
(
!
policy
)
return_VALUE
(
-
EINVAL
);
return_VALUE
(
-
EINVAL
);
/* get a present, initialized CPU */
pr
=
processors
[
policy
->
cpu
];
if
(
policy
->
cpu
==
CPUFREQ_ALL_CPUS
)
if
(
!
pr
)
{
return_VALUE
(
-
EINVAL
);
for
(
i
=
0
;
i
<
NR_CPUS
;
i
++
)
{
if
(
processors
[
i
]
!=
NULL
)
{
cpu
=
i
;
pr
=
processors
[
cpu
];
break
;
}
}
}
else
{
cpu
=
policy
->
cpu
;
pr
=
processors
[
cpu
];
if
(
!
pr
)
return_VALUE
(
-
EINVAL
);
}
/* first check if min and max are within valid limits */
/* first check if min and max are within valid limits */
cpufreq_verify_within_limits
(
cpufreq_verify_within_limits
(
...
@@ -1787,6 +1745,11 @@ acpi_cpufreq_verify (
...
@@ -1787,6 +1745,11 @@ acpi_cpufreq_verify (
policy
->
max
=
pr
->
performance
.
states
[
next_larger_state
].
core_frequency
*
1000
;
policy
->
max
=
pr
->
performance
.
states
[
next_larger_state
].
core_frequency
*
1000
;
}
}
cpufreq_verify_within_limits
(
policy
,
pr
->
performance
.
states
[
pr
->
performance
.
state_count
-
1
].
core_frequency
*
1000
,
pr
->
performance
.
states
[
pr
->
limit
.
state
.
px
].
core_frequency
*
1000
);
return_VALUE
(
0
);
return_VALUE
(
0
);
}
}
...
...
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