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 back earlier cpufreq material for 7.1

+34 -14
+2 -1
drivers/acpi/cppc_acpi.c
··· 1944 1944 } 1945 1945 1946 1946 /* Look up the max frequency in DMI */ 1947 - static u64 cppc_get_dmi_max_khz(void) 1947 + u64 cppc_get_dmi_max_khz(void) 1948 1948 { 1949 1949 u16 mhz = 0; 1950 1950 ··· 1958 1958 1959 1959 return KHZ_PER_MHZ * mhz; 1960 1960 } 1961 + EXPORT_SYMBOL_GPL(cppc_get_dmi_max_khz); 1961 1962 1962 1963 /* 1963 1964 * If CPPC lowest_freq and nominal_freq registers are exposed then we can
+24 -7
drivers/cpufreq/acpi-cpufreq.c
··· 675 675 } 676 676 #endif 677 677 678 + static void acpi_cpufreq_resolve_max_freq(struct cpufreq_policy *policy, 679 + unsigned int pss_max_freq) 680 + { 681 + #ifdef CONFIG_ACPI_CPPC_LIB 682 + u64 max_speed = cppc_get_dmi_max_khz(); 683 + /* 684 + * Use DMI "Max Speed" if it looks plausible: must be 685 + * above _PSS P0 frequency and within 2x of it. 686 + */ 687 + if (max_speed > pss_max_freq && max_speed < pss_max_freq * 2) { 688 + policy->cpuinfo.max_freq = max_speed; 689 + return; 690 + } 691 + #endif 692 + /* 693 + * If the maximum "boost" frequency is unknown, ask the arch 694 + * scale-invariance code to use the "nominal" performance for 695 + * CPU utilization scaling so as to prevent the schedutil 696 + * governor from selecting inadequate CPU frequencies. 697 + */ 698 + arch_set_max_freq_ratio(true); 699 + } 700 + 678 701 static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) 679 702 { 680 703 struct cpufreq_frequency_table *freq_table; ··· 872 849 873 850 policy->cpuinfo.max_freq = freq * max_boost_ratio >> SCHED_CAPACITY_SHIFT; 874 851 } else { 875 - /* 876 - * If the maximum "boost" frequency is unknown, ask the arch 877 - * scale-invariance code to use the "nominal" performance for 878 - * CPU utilization scaling so as to prevent the schedutil 879 - * governor from selecting inadequate CPU frequencies. 880 - */ 881 - arch_set_max_freq_ratio(true); 852 + acpi_cpufreq_resolve_max_freq(policy, freq_table[0].frequency); 882 853 } 883 854 884 855 policy->freq_table = freq_table;
+2 -2
drivers/cpufreq/cpufreq.c
··· 2364 2364 target_freq = __resolve_freq(policy, target_freq, policy->min, 2365 2365 policy->max, relation); 2366 2366 2367 - pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", 2368 - policy->cpu, target_freq, relation, old_target_freq); 2367 + pr_debug("CPU %u: cur %u kHz -> target %u kHz (req %u kHz, rel %u)\n", 2368 + policy->cpu, policy->cur, target_freq, old_target_freq, relation); 2369 2369 2370 2370 /* 2371 2371 * This might look like a redundant call as we are checking it again
+3 -2
drivers/cpufreq/cpufreq_governor.h
··· 21 21 #include <linux/kernel_stat.h> 22 22 #include <linux/module.h> 23 23 #include <linux/mutex.h> 24 + #include <linux/sysfs.h> 24 25 25 26 /* Ondemand Sampling types */ 26 27 enum {OD_NORMAL_SAMPLE, OD_SUB_SAMPLE}; ··· 58 57 { \ 59 58 struct dbs_data *dbs_data = to_dbs_data(attr_set); \ 60 59 struct _gov##_dbs_tuners *tuners = dbs_data->tuners; \ 61 - return sprintf(buf, "%u\n", tuners->file_name); \ 60 + return sysfs_emit(buf, "%u\n", tuners->file_name); \ 62 61 } 63 62 64 63 #define gov_show_one_common(file_name) \ ··· 66 65 (struct gov_attr_set *attr_set, char *buf) \ 67 66 { \ 68 67 struct dbs_data *dbs_data = to_dbs_data(attr_set); \ 69 - return sprintf(buf, "%u\n", dbs_data->file_name); \ 68 + return sysfs_emit(buf, "%u\n", dbs_data->file_name); \ 70 69 } 71 70 72 71 #define gov_attr_ro(_name) \
+1 -1
drivers/cpufreq/intel_pstate.c
··· 3472 3472 { 3473 3473 if (size == 3 && !strncmp(buf, "off", size)) { 3474 3474 if (!intel_pstate_driver) 3475 - return -EINVAL; 3475 + return 0; 3476 3476 3477 3477 if (hwp_active) 3478 3478 return -EBUSY;
+1
include/acpi/cppc_acpi.h
··· 156 156 extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps); 157 157 extern bool cppc_perf_ctrs_in_pcc_cpu(unsigned int cpu); 158 158 extern bool cppc_perf_ctrs_in_pcc(void); 159 + extern u64 cppc_get_dmi_max_khz(void); 159 160 extern unsigned int cppc_perf_to_khz(struct cppc_perf_caps *caps, unsigned int perf); 160 161 extern unsigned int cppc_khz_to_perf(struct cppc_perf_caps *caps, unsigned int freq); 161 162 extern bool acpi_cpc_valid(void);
+1 -1
include/linux/cpufreq.h
··· 232 232 233 233 static inline bool policy_is_shared(struct cpufreq_policy *policy) 234 234 { 235 - return cpumask_weight(policy->cpus) > 1; 235 + return cpumask_nth(1, policy->cpus) < nr_cpumask_bits; 236 236 } 237 237 238 238 #ifdef CONFIG_CPU_FREQ