Commit 326e311b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pm-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fixes from Rafael Wysocki:
 "These fix the recently added Tegra194 cpufreq driver and the handling
  of devices using runtime PM during system-wide suspend, improve the
  intel_pstate driver documentation and clean up the cpufreq core.

  Specifics:

   - Make the recently added Tegra194 cpufreq driver use
     read_cpuid_mpir() instead of cpu_logical_map() to avoid exporting
     logical_cpu_map (Sumit Gupta).

   - Drop the automatic system wakeup event reporting for devices with
     pending runtime-resume requests during system-wide suspend to avoid
     spurious aborts of the suspend flow (Rafael Wysocki).

   - Fix build warning in the intel_pstate driver documentation and
     improve the wording in there (Randy Dunlap).

   - Clean up two pieces of code in the cpufreq core (Viresh Kumar)"

* tag 'pm-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: Use WARN_ON_ONCE() for invalid relation
  cpufreq: No need to verify cpufreq_driver in show_scaling_cur_freq()
  PM: sleep: core: Fix the handling of pending runtime resume requests
  Documentation: fix pm/intel_pstate build warning and wording
  cpufreq: replace cpu_logical_map() with read_cpuid_mpir()
parents 96d454cd ef7d9604
...@@ -564,8 +564,8 @@ Energy-Performance Preference (EPP) knob (if supported) or its ...@@ -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
......
...@@ -1606,13 +1606,17 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) ...@@ -1606,13 +1606,17 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
} }
/* /*
* If a device configured to wake up the system from sleep states * Wait for possible runtime PM transitions of the device in progress
* has been suspended at run time and there's a resume request pending * to complete and if there's a runtime resume request pending for it,
* for it, this is equivalent to the device signaling wakeup, so the * resume it before proceeding with invoking the system-wide suspend
* system suspend operation should be aborted. * callbacks for it.
*
* If the system-wide suspend callbacks below change the configuration
* of the device, they must disable runtime PM for it or otherwise
* ensure that its runtime-resume callbacks will not be confused by that
* change in case they are invoked going forward.
*/ */
if (pm_runtime_barrier(dev) && device_may_wakeup(dev)) pm_runtime_barrier(dev);
pm_wakeup_event(dev, 0);
if (pm_wakeup_pending()) { if (pm_wakeup_pending()) {
dev->power.direct_complete = false; dev->power.direct_complete = false;
......
...@@ -703,8 +703,7 @@ static ssize_t show_scaling_cur_freq(struct cpufreq_policy *policy, char *buf) ...@@ -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);
......
...@@ -56,9 +56,11 @@ struct read_counters_work { ...@@ -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) ...@@ -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;
......
...@@ -956,8 +956,8 @@ static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy, ...@@ -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;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment