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
564Energy-Performance Bias (EPB) knob. It is also possible to write a positive564Energy-Performance Bias (EPB) knob. It is also possible to write a positive
565integer value between 0 to 255, if the EPP feature is present. If the EPP565integer value between 0 to 255, if the EPP feature is present. If the EPP
566feature is not present, writing integer value to this attribute is not566feature is not present, writing integer value to this attribute is not
567supported. In this case, user can use567supported. In this case, user can use the
568 "/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface.568"/sys/devices/system/cpu/cpu*/power/energy_perf_bias" interface.
569 569
570[Note that tasks may by migrated from one CPU to another by the scheduler's570[Note that tasks may by migrated from one CPU to another by the scheduler's
571load-balancing algorithm and if different energy vs performance hints are571load-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
703 freq = arch_freq_get_on_cpu(policy->cpu);703 freq = arch_freq_get_on_cpu(policy->cpu);
704 if (freq)704 if (freq)
705 ret = sprintf(buf, "%u\n", freq);705 ret = sprintf(buf, "%u\n", freq);
706 else if (cpufreq_driver && cpufreq_driver->setpolicy &&706 else if (cpufreq_driver->setpolicy && cpufreq_driver->get)
707 cpufreq_driver->get)
708 ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu));707 ret = sprintf(buf, "%u\n", cpufreq_driver->get(policy->cpu));
709 else708 else
710 ret = sprintf(buf, "%u\n", policy->cur);709 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
56 56
57static struct workqueue_struct *read_counters_wq;57static struct workqueue_struct *read_counters_wq;
58 58
59static enum cluster get_cpu_cluster(u8 cpu)59static 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
186static int tegra194_cpufreq_init(struct cpufreq_policy *policy)188static int tegra194_cpufreq_init(struct cpufreq_policy *policy)
187{189{
188 struct tegra194_cpufreq_data *data = cpufreq_get_driver_data();190 struct tegra194_cpufreq_data *data = cpufreq_get_driver_data();
189 int cl = get_cpu_cluster(policy->cpu);
190 u32 cpu;191 u32 cpu;
192 u32 cl;
193
194 smp_call_function_single(policy->cpu, get_cpu_cluster, &cl, true);
191 195
192 if (cl >= data->num_clusters)196 if (cl >= data->num_clusters)
193 return -EINVAL;197 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
956 case CPUFREQ_RELATION_C:956 case CPUFREQ_RELATION_C:
957 return cpufreq_table_find_index_c(policy, target_freq);957 return cpufreq_table_find_index_c(policy, target_freq);
958 default:958 default:
959 pr_err("%s: Invalid relation: %d\n", __func__, relation);959 WARN_ON_ONCE(1);
960 return -EINVAL;960 return 0;
961 }961 }
962}962}
963 963