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: Prepare for MSR/sysfs refactoring

Rename routines to make "_msr" and "_sysfs" access methods clear

No functional change

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

Len Brown 8ef8fa82 c97c057d

+19 -19
+19 -19
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c
··· 809 809 h->hwp_min, h->hwp_max, h->hwp_desired, h->hwp_epp, 810 810 h->hwp_window, h->hwp_window & 0x7F, (h->hwp_window >> 7) & 0x7); 811 811 } 812 - void read_hwp_request(int cpu, struct msr_hwp_request *hwp_req, unsigned int msr_offset) 812 + void read_hwp_request_msr(int cpu, struct msr_hwp_request *hwp_req, unsigned int msr_offset) 813 813 { 814 814 unsigned long long msr; 815 815 ··· 823 823 hwp_req->hwp_use_pkg = (((msr) >> 42) & 0x1); 824 824 } 825 825 826 - void write_hwp_request(int cpu, struct msr_hwp_request *hwp_req, unsigned int msr_offset) 826 + void write_hwp_request_msr(int cpu, struct msr_hwp_request *hwp_req, unsigned int msr_offset) 827 827 { 828 828 unsigned long long msr = 0; 829 829 ··· 843 843 put_msr(cpu, msr_offset, msr); 844 844 } 845 845 846 - static int get_epb(int cpu) 846 + static int get_epb_sysfs(int cpu) 847 847 { 848 848 char path[SYSFS_PATH_MAX]; 849 849 char linebuf[3]; ··· 865 865 return (int)val; 866 866 } 867 867 868 - static int set_epb(int cpu, int val) 868 + static int set_epb_sysfs(int cpu, int val) 869 869 { 870 870 char path[SYSFS_PATH_MAX]; 871 871 char linebuf[3]; ··· 895 895 struct msr_hwp_cap cap; 896 896 int epb; 897 897 898 - epb = get_epb(cpu); 898 + epb = get_epb_sysfs(cpu); 899 899 if (epb >= 0) 900 900 printf("cpu%d: EPB %u\n", cpu, (unsigned int) epb); 901 901 902 902 if (!has_hwp) 903 903 return 0; 904 904 905 - read_hwp_request(cpu, &req, MSR_HWP_REQUEST); 905 + read_hwp_request_msr(cpu, &req, MSR_HWP_REQUEST); 906 906 print_hwp_request(cpu, &req, ""); 907 907 908 908 read_hwp_cap(cpu, &cap, MSR_HWP_CAPABILITIES); ··· 919 919 if (!has_hwp) 920 920 return 0; 921 921 922 - read_hwp_request(first_cpu_in_pkg[pkg], &req, MSR_HWP_REQUEST_PKG); 922 + read_hwp_request_msr(first_cpu_in_pkg[pkg], &req, MSR_HWP_REQUEST_PKG); 923 923 print_hwp_request_pkg(pkg, &req, ""); 924 924 925 925 if (has_hwp_notify) { ··· 1074 1074 return 0; 1075 1075 } 1076 1076 1077 - int update_hwp_request(int cpu) 1077 + int update_hwp_request_msr(int cpu) 1078 1078 { 1079 1079 struct msr_hwp_request req; 1080 1080 struct msr_hwp_cap cap; 1081 1081 1082 1082 int msr_offset = MSR_HWP_REQUEST; 1083 1083 1084 - read_hwp_request(cpu, &req, msr_offset); 1084 + read_hwp_request_msr(cpu, &req, msr_offset); 1085 1085 if (debug) 1086 1086 print_hwp_request(cpu, &req, "old: "); 1087 1087 ··· 1111 1111 1112 1112 verify_hwp_req_self_consistency(cpu, &req); 1113 1113 1114 - write_hwp_request(cpu, &req, msr_offset); 1114 + write_hwp_request_msr(cpu, &req, msr_offset); 1115 1115 1116 1116 if (debug) { 1117 - read_hwp_request(cpu, &req, msr_offset); 1117 + read_hwp_request_msr(cpu, &req, msr_offset); 1118 1118 print_hwp_request(cpu, &req, "new: "); 1119 1119 } 1120 1120 return 0; 1121 1121 } 1122 - int update_hwp_request_pkg(int pkg) 1122 + int update_hwp_request_pkg_msr(int pkg) 1123 1123 { 1124 1124 struct msr_hwp_request req; 1125 1125 struct msr_hwp_cap cap; ··· 1127 1127 1128 1128 int msr_offset = MSR_HWP_REQUEST_PKG; 1129 1129 1130 - read_hwp_request(cpu, &req, msr_offset); 1130 + read_hwp_request_msr(cpu, &req, msr_offset); 1131 1131 if (debug) 1132 1132 print_hwp_request_pkg(pkg, &req, "old: "); 1133 1133 ··· 1155 1155 1156 1156 verify_hwp_req_self_consistency(cpu, &req); 1157 1157 1158 - write_hwp_request(cpu, &req, msr_offset); 1158 + write_hwp_request_msr(cpu, &req, msr_offset); 1159 1159 1160 1160 if (debug) { 1161 - read_hwp_request(cpu, &req, msr_offset); 1161 + read_hwp_request_msr(cpu, &req, msr_offset); 1162 1162 print_hwp_request_pkg(pkg, &req, "new: "); 1163 1163 } 1164 1164 return 0; ··· 1188 1188 int epb; 1189 1189 1190 1190 if (update_epb) { 1191 - epb = get_epb(cpu); 1192 - set_epb(cpu, new_epb); 1191 + epb = get_epb_sysfs(cpu); 1192 + set_epb_sysfs(cpu, new_epb); 1193 1193 1194 1194 if (verbose) 1195 1195 printf("cpu%d: ENERGY_PERF_BIAS old: %d new: %d\n", ··· 1229 1229 if (!hwp_update_enabled()) 1230 1230 return 0; 1231 1231 1232 - update_hwp_request(cpu); 1232 + update_hwp_request_msr(cpu); 1233 1233 return 0; 1234 1234 } 1235 1235 ··· 1587 1587 for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_sysfs); 1588 1588 for_all_cpus_in_set(cpu_setsize, cpu_selected_set, update_cpu_msrs); 1589 1589 } else if (pkg_selected_set) 1590 - for_packages(pkg_selected_set, update_hwp_request_pkg); 1590 + for_packages(pkg_selected_set, update_hwp_request_pkg_msr); 1591 1591 1592 1592 return 0; 1593 1593 }