Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/power x86_energy_perf_policy: Prefer driver HWP limits

When we are successful in using cpufreq min/max limits,
skip setting the raw MSR limits entirely.

This is necessary to avoid undoing any modification that
the cpufreq driver makes to our sysfs request.

eg. intel_pstate may take our request for a limit
that is valid according to HWP.CAP.MIN/MAX and clip
it to be within the range available in PLATFORM_INFO.

Signed-off-by: Len Brown <len.brown@intel.com>

Len Brown 2734fdbc f8241f54

+9 -4
+9 -4
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
··· 62 62 unsigned char update_hwp_epp; 63 63 unsigned char update_hwp_min; 64 64 unsigned char update_hwp_max; 65 + unsigned char hwp_limits_done_via_sysfs; 65 66 unsigned char update_hwp_desired; 66 67 unsigned char update_hwp_window; 67 68 unsigned char update_hwp_use_pkg; ··· 952 951 } 953 952 /* 954 953 * If HWP is enabled and cpufreq sysfs attribtes are present, 955 - * then update sysfs, so that it will not become 956 - * stale when we write to MSRs. 954 + * then update via sysfs. The intel_pstate driver may modify (clip) 955 + * this request, say, when HWP_CAP is outside of PLATFORM_INFO limits, 956 + * and the driver-chosen value takes precidence. 957 + * 957 958 * (intel_pstate's max_perf_pct and min_perf_pct will follow cpufreq, 958 959 * so we don't have to touch that.) 959 960 */ ··· 1009 1006 1010 1007 if (update_hwp_max) 1011 1008 update_cpufreq_scaling_freq(1, cpu, req_update.hwp_max); 1009 + 1010 + hwp_limits_done_via_sysfs = 1; 1012 1011 1013 1012 return 0; 1014 1013 } ··· 1090 1085 if (debug) 1091 1086 print_hwp_request(cpu, &req, "old: "); 1092 1087 1093 - if (update_hwp_min) 1088 + if (update_hwp_min && !hwp_limits_done_via_sysfs) 1094 1089 req.hwp_min = req_update.hwp_min; 1095 1090 1096 - if (update_hwp_max) 1091 + if (update_hwp_max && !hwp_limits_done_via_sysfs) 1097 1092 req.hwp_max = req_update.hwp_max; 1098 1093 1099 1094 if (update_hwp_desired)