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.

Merge branch 'intel-sst' of https://github.com/spandruvada/linux-kernel into review-ilpo-next

+24 -17
+24 -17
tools/power/x86/intel-speed-select/isst-config.c
··· 16 16 int arg; 17 17 }; 18 18 19 - static const char *version_str = "v1.25"; 19 + static const char *version_str = "v1.26"; 20 20 21 21 static const int supported_api_ver = 3; 22 22 static struct isst_if_platform_info isst_platform_info; ··· 26 26 27 27 static int cpu_model; 28 28 static int cpu_stepping; 29 - static int extended_family; 29 + static int cpu_family; 30 30 31 31 #define MAX_CPUS_IN_ONE_REQ 512 32 32 static short max_target_cpus; ··· 81 81 }; 82 82 83 83 static int read_only; 84 + 85 + static void print_version(void) 86 + { 87 + fprintf(outf, "Version %s\n", version_str); 88 + } 84 89 85 90 static void check_privilege(void) 86 91 { ··· 163 158 164 159 static int is_dmr_plus_platform(void) 165 160 { 166 - if (extended_family == 0x04) 161 + if (cpu_family == 19) 167 162 return 1; 168 163 169 164 return 0; ··· 172 167 static int update_cpu_model(void) 173 168 { 174 169 unsigned int ebx, ecx, edx; 175 - unsigned int fms, family; 170 + unsigned int fms; 176 171 177 172 __cpuid(1, fms, ebx, ecx, edx); 178 - family = (fms >> 8) & 0xf; 179 - extended_family = (fms >> 20) & 0x0f; 173 + cpu_family = (fms >> 8) & 0xf; 174 + if (cpu_family == 0xf) 175 + cpu_family += (fms >> 20) & 0xff; 180 176 cpu_model = (fms >> 4) & 0xf; 181 - if (family == 6 || family == 0xf) 177 + if (cpu_family == 6 || cpu_family == 0xf) 182 178 cpu_model += ((fms >> 16) & 0xf) << 4; 183 179 184 180 cpu_stepping = fms & 0xf; ··· 1143 1137 close(fd); 1144 1138 1145 1139 if (isst_platform_info.api_version > supported_api_ver) { 1140 + print_version(); 1146 1141 printf("Incompatible API versions; Upgrade of tool is required\n"); 1147 - return -1; 1142 + exit(1); 1148 1143 } 1149 1144 1150 1145 set_platform_ops: ··· 1751 1744 return parse_int_file(0, "/sys/devices/system/cpu/intel_pstate/no_turbo"); 1752 1745 } 1753 1746 1747 + #define U32_MAX ((unsigned int)~0U) 1748 + #define S32_MAX ((int)(U32_MAX >> 1)) 1749 + 1754 1750 static void adjust_scaling_max_from_base_freq(int cpu) 1755 1751 { 1756 1752 int base_freq, scaling_max_freq; ··· 1761 1751 scaling_max_freq = parse_int_file(0, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", cpu); 1762 1752 base_freq = get_cpufreq_base_freq(cpu); 1763 1753 if (scaling_max_freq < base_freq || no_turbo()) 1764 - set_cpufreq_scaling_min_max(cpu, 1, base_freq); 1754 + set_cpufreq_scaling_min_max(cpu, 1, S32_MAX); 1765 1755 } 1766 1756 1767 1757 static void adjust_scaling_min_from_base_freq(int cpu) ··· 3201 3191 printf("\tTo get full turbo-freq information dump:\n"); 3202 3192 printf("\t\tintel-speed-select turbo-freq info -l 0\n"); 3203 3193 } 3204 - exit(1); 3205 - } 3206 - 3207 - static void print_version(void) 3208 - { 3209 - fprintf(outf, "Version %s\n", version_str); 3210 3194 exit(0); 3211 3195 } 3212 3196 ··· 3250 3246 } 3251 3247 3252 3248 ret = update_cpu_model(); 3253 - if (ret) 3254 - err(-1, "Invalid CPU model (%d)\n", cpu_model); 3249 + if (ret) { 3250 + fprintf(stderr, "Invalid CPU model (%d)\n", cpu_model); 3251 + exit(1); 3252 + } 3255 3253 printf("Intel(R) Speed Select Technology\n"); 3256 3254 printf("Executing on CPU model:%d[0x%x]\n", cpu_model, cpu_model); 3257 3255 ··· 3317 3311 break; 3318 3312 case 'v': 3319 3313 print_version(); 3314 + exit(0); 3320 3315 break; 3321 3316 case 'b': 3322 3317 oob_mode = 1;