tools/power x86_energy_perf_policy: EPB access is only via sysfs
authorLen Brown <len.brown@intel.com>
Fri, 19 Sep 2025 19:35:07 +0000 (15:35 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 26 Sep 2025 03:12:01 +0000 (23:12 -0400)
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>
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c

index ce6fb80..fe10057 100644 (file)
@@ -1182,19 +1182,23 @@ int enable_hwp_on_cpu(int cpu)
        return 0;
 }
 
-int update_cpu_msrs(int cpu)
+int update_cpu_epb_sysfs(int cpu)
 {
-       unsigned long long msr;
        int epb;
 
-       if (update_epb) {
-               epb = get_epb_sysfs(cpu);
-               set_epb_sysfs(cpu, new_epb);
+       epb = get_epb_sysfs(cpu);
+       set_epb_sysfs(cpu, new_epb);
 
-               if (verbose)
-                       printf("cpu%d: ENERGY_PERF_BIAS old: %d new: %d\n",
-                               cpu, epb, (unsigned int) new_epb);
-       }
+       if (verbose)
+               printf("cpu%d: ENERGY_PERF_BIAS old: %d new: %d\n",
+                       cpu, epb, (unsigned int) new_epb);
+
+       return 0;
+}
+
+int update_cpu_msrs(int cpu)
+{
+       unsigned long long msr;
 
        if (update_turbo) {
                int turbo_is_present_and_disabled;
@@ -1584,8 +1588,11 @@ int main(int argc, char **argv)
 
        /* update CPU set */
        if (cpu_selected_set) {
+               if (update_epb)
+                       for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_cpu_epb_sysfs);
                for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_sysfs);
                for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_cpu_msrs);
+
        } else if (pkg_selected_set)
                for_packages(pkg_selected_set, update_hwp_request_pkg_msr);