* 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()
Unified · Split
| @@ -564,8 +564,8 @@ Energy-Performance Preference (EPP) knob (if supported) or its · 563 unmodified lines | ||
| 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 |
| @@ -703,8 +703,7 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf) · 702 unmodified lines | ||
| 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); |
| @@ -56,9 +56,11 @@ struct read_counters_work { · 55 unmodified lines | ||
| 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 | /* |
| @@ -186,8 +188,10 @@ static unsigned int tegra194_get_speed(u32 cpu) · 121 unmodified lines | ||
| 186 | 188 | static int tegra194_cpufreq_init(struct cpufreq_policy *policy) |
| 187 | 189 | { |
| 188 | 190 | struct tegra194_cpufreq_data *data = cpufreq_get_driver_data(); |
| 189 | − int cl = get_cpu_cluster(policy->cpu); | |
| 190 | 191 | u32 cpu; |
| 192 | + u32 cl; | |
| 193 | + | |
| 194 | + smp_call_function_single(policy->cpu, get_cpu_cluster, &cl, true); | |
| 191 | 195 | |
| 192 | 196 | if (cl >= data->num_clusters) |
| 193 | 197 | return -EINVAL; |
| @@ -956,8 +956,8 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy, · 955 unmodified lines | ||
| 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 | |