Skip to content

Commit f8241f5

Browse files
committed
tools/power x86_energy_perf_policy: EPB access is only via sysfs
Comprehend that EPB writes are now only via sysfs by moving it out of the _msr specific path. No functional change. Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 8ef8fa8 commit f8241f5

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,19 +1182,23 @@ int enable_hwp_on_cpu(int cpu)
11821182
return 0;
11831183
}
11841184

1185-
int update_cpu_msrs(int cpu)
1185+
int update_cpu_epb_sysfs(int cpu)
11861186
{
1187-
unsigned long long msr;
11881187
int epb;
11891188

1190-
if (update_epb) {
1191-
epb = get_epb_sysfs(cpu);
1192-
set_epb_sysfs(cpu, new_epb);
1189+
epb = get_epb_sysfs(cpu);
1190+
set_epb_sysfs(cpu, new_epb);
11931191

1194-
if (verbose)
1195-
printf("cpu%d: ENERGY_PERF_BIAS old: %d new: %d\n",
1196-
cpu, epb, (unsigned int) new_epb);
1197-
}
1192+
if (verbose)
1193+
printf("cpu%d: ENERGY_PERF_BIAS old: %d new: %d\n",
1194+
cpu, epb, (unsigned int) new_epb);
1195+
1196+
return 0;
1197+
}
1198+
1199+
int update_cpu_msrs(int cpu)
1200+
{
1201+
unsigned long long msr;
11981202

11991203
if (update_turbo) {
12001204
int turbo_is_present_and_disabled;
@@ -1584,8 +1588,11 @@ int main(int argc, char **argv)
15841588

15851589
/* update CPU set */
15861590
if (cpu_selected_set) {
1591+
if (update_epb)
1592+
for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_cpu_epb_sysfs);
15871593
for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_sysfs);
15881594
for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_cpu_msrs);
1595+
15891596
} else if (pkg_selected_set)
15901597
for_packages(pkg_selected_set, update_hwp_request_pkg_msr);
15911598

0 commit comments

Comments
 (0)