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

Merge branch 'pm-cpufreq'

* pm-cpufreq:
cpufreq: Use WARN_ON_ONCE() for invalid relation
cpufreq: No need to verify cpufreq_driver in show_scaling_cur_freq()
Documentation: fix pm/intel_pstate build warning and wording
cpufreq: replace cpu_logical_map() with read_cpuid_mpir()

+12 -9
+2 -2
Documentation/admin-guide/pm/intel_pstate.rst
··· 564 564 Energy-Performance Bias (EPB) knob. It is also possible to write a positive 565 565 integer value between 0 to 255, if the EPP feature is present. If the EPP 566 566 feature is not present, writing integer value to this attribute is not 567 - supported. In this case, user can use 568 - "/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface. 567 + supported. In this case, user can use the 568 + "/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface. 569 569 570 570 [Note that tasks may by migrated from one CPU to another by the scheduler's 571 571 load-balancing algorithm and if different energy vs performance hints are
+1 -2
drivers/cpufreq/cpufreq.c
··· 703 703 freq = arch_freq_get_on_cpu(policy->cpu); 704 704 if (freq) 705 705 ret = sprintf(buf, "%u\n", freq); 706 - else if (cpufreq_driver && cpufreq_driver->setpolicy && 707 - cpufreq_driver->get) 706 + else if (cpufreq_driver->setpolicy && cpufreq_driver->get) 708 707 ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu)); 709 708 else 710 709 ret = sprintf(buf, "%u\n", policy->cur);
+7 -3
drivers/cpufreq/tegra194-cpufreq.c
··· 56 56 57 57 static struct workqueue_struct *read_counters_wq; 58 58 59 - static enum cluster get_cpu_cluster(u8 cpu) 59 + static void get_cpu_cluster(void *cluster) 60 60 { 61 - return MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 1); 61 + u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK; 62 + 63 + *((uint32_t *)cluster) = MPIDR_AFFINITY_LEVEL(mpidr, 1); 62 64 } 63 65 64 66 /* ··· 188 186 static int tegra194_cpufreq_init(struct cpufreq_policy *policy) 189 187 { 190 188 struct tegra194_cpufreq_data *data = cpufreq_get_driver_data(); 191 - int cl = get_cpu_cluster(policy->cpu); 192 189 u32 cpu; 190 + u32 cl; 191 + 192 + smp_call_function_single(policy->cpu, get_cpu_cluster, &cl, true); 193 193 194 194 if (cl >= data->num_clusters) 195 195 return -EINVAL;
+2 -2
include/linux/cpufreq.h
··· 956 956 case CPUFREQ_RELATION_C: 957 957 return cpufreq_table_find_index_c(policy, target_freq); 958 958 default: 959 - pr_err("%s: Invalid relation: %d\n", __func__, relation); 960 - return -EINVAL; 959 + WARN_ON_ONCE(1); 960 + return 0; 961 961 } 962 962 } 963 963