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()
This commit is contained in:
Rafael J. Wysocki 2020-08-28 20:58:16 +02:00
commit ef7d960403
4 changed files with 12 additions and 9 deletions

View File

@ -564,8 +564,8 @@ Energy-Performance Preference (EPP) knob (if supported) or its
Energy-Performance Bias (EPB) knob. It is also possible to write a positive Energy-Performance Bias (EPB) knob. It is also possible to write a positive
integer value between 0 to 255, if the EPP feature is present. If the EPP integer value between 0 to 255, if the EPP feature is present. If the EPP
feature is not present, writing integer value to this attribute is not feature is not present, writing integer value to this attribute is not
supported. In this case, user can use supported. In this case, user can use the
"/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface. "/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface.
[Note that tasks may by migrated from one CPU to another by the scheduler's [Note that tasks may by migrated from one CPU to another by the scheduler's
load-balancing algorithm and if different energy vs performance hints are load-balancing algorithm and if different energy vs performance hints are

View File

@ -703,8 +703,7 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf)
freq = arch_freq_get_on_cpu(policy->cpu); freq = arch_freq_get_on_cpu(policy->cpu);
if (freq) if (freq)
ret = sprintf(buf, "%u\n", freq); ret = sprintf(buf, "%u\n", freq);
else if (cpufreq_driver && cpufreq_driver->setpolicy && else if (cpufreq_driver->setpolicy && cpufreq_driver->get)
cpufreq_driver->get)
ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu)); ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu));
else else
ret = sprintf(buf, "%u\n", policy->cur); ret = sprintf(buf, "%u\n", policy->cur);

View File

@ -56,9 +56,11 @@ struct read_counters_work {
static struct workqueue_struct *read_counters_wq; static struct workqueue_struct *read_counters_wq;
static enum cluster get_cpu_cluster(u8 cpu) static void get_cpu_cluster(void *cluster)
{ {
return MPIDR_AFFINITY_LEVEL(cpu_logical_map(cpu), 1); u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
*((uint32_t *)cluster) = MPIDR_AFFINITY_LEVEL(mpidr, 1);
} }
/* /*
@ -186,8 +188,10 @@ static unsigned int tegra194_get_speed(u32 cpu)
static int tegra194_cpufreq_init(struct cpufreq_policy *policy) static int tegra194_cpufreq_init(struct cpufreq_policy *policy)
{ {
struct tegra194_cpufreq_data *data = cpufreq_get_driver_data(); struct tegra194_cpufreq_data *data = cpufreq_get_driver_data();
int cl = get_cpu_cluster(policy->cpu);
u32 cpu; u32 cpu;
u32 cl;
smp_call_function_single(policy->cpu, get_cpu_cluster, &cl, true);
if (cl >= data->num_clusters) if (cl >= data->num_clusters)
return -EINVAL; return -EINVAL;

View File

@ -956,8 +956,8 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
case CPUFREQ_RELATION_C: case CPUFREQ_RELATION_C:
return cpufreq_table_find_index_c(policy, target_freq); return cpufreq_table_find_index_c(policy, target_freq);
default: default:
pr_err("%s: Invalid relation: %d\n", __func__, relation); WARN_ON_ONCE(1);
return -EINVAL; return 0;
} }
} }