History

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()

Rafael J. Wysocki committed 6 years ago

Commit ef7d9602 parents e3eb6e8 30b8e6b4 files · +12 −9Browse files

Unified · Split

4 files
  1. Documentation/admin-guide/pm/intel_pstate.rst +2 −2
  2. drivers/cpufreq/cpufreq.c +1 −2
  3. drivers/cpufreq/tegra194-cpufreq.c +7 −3
  4. include/linux/cpufreq.h +2 −2
Documentation/admin-guide/pm/intel_pstate.rst+2−2
@@ -564,8 +564,8 @@ Energy-Performance Preference (EPP) knob (if supported) or its · 563 unmodified lines
564564 Energy-Performance Bias (EPB) knob. It is also possible to write a positive
565565 integer value between 0 to 255, if the EPP feature is present. If the EPP
566566 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.
569569
570570 [Note that tasks may by migrated from one CPU to another by the scheduler's
571571 load-balancing algorithm and if different energy vs performance hints are
drivers/cpufreq/cpufreq.c+1−2
@@ -703,8 +703,7 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf) · 702 unmodified lines
703703 freq = arch_freq_get_on_cpu(policy->cpu);
704704 if (freq)
705705 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)
708707 ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu));
709708 else
710709 ret = sprintf(buf, "%u\n", policy->cur);
drivers/cpufreq/tegra194-cpufreq.c+7−3
@@ -56,9 +56,11 @@ struct read_counters_work { · 55 unmodified lines
5656
5757 static struct workqueue_struct *read_counters_wq;
5858
59−static enum cluster get_cpu_cluster(u8 cpu)
59+static void get_cpu_cluster(void *cluster)
6060 {
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);
6264 }
6365
6466 /*
@@ -186,8 +188,10 @@ static unsigned int tegra194_get_speed(u32 cpu) · 121 unmodified lines
186188 static int tegra194_cpufreq_init(struct cpufreq_policy *policy)
187189 {
188190 struct tegra194_cpufreq_data *data = cpufreq_get_driver_data();
189− int cl = get_cpu_cluster(policy->cpu);
190191 u32 cpu;
192+ u32 cl;
193+
194+ smp_call_function_single(policy->cpu, get_cpu_cluster, &cl, true);
191195
192196 if (cl >= data->num_clusters)
193197 return -EINVAL;
include/linux/cpufreq.h+2−2
@@ -956,8 +956,8 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy, · 955 unmodified lines
956956 case CPUFREQ_RELATION_C:
957957 return cpufreq_table_find_index_c(policy, target_freq);
958958 default:
959− pr_err("%s: Invalid relation: %d\n", __func__, relation);
960− return -EINVAL;
959+ WARN_ON_ONCE(1);
960+ return 0;
961961 }
962962 }
963963