forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'pm-5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/g…
…it/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Fix a problem related to CPU offline/online and cpufreq governors that in some system configurations may lead to a system-wide deadlock during CPU online" * tag 'pm-5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: Avoid leaving stale IRQ work items during CPU offline
- Loading branch information
Showing
4 changed files
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
* Copyright (C) 2016, Intel Corporation | ||
* Author: Rafael J. Wysocki <[email protected]> | ||
*/ | ||
#include <linux/cpufreq.h> | ||
|
||
#include "sched.h" | ||
|
||
DEFINE_PER_CPU(struct update_util_data __rcu *, cpufreq_update_util_data); | ||
|
@@ -57,3 +59,19 @@ void cpufreq_remove_update_util_hook(int cpu) | |
rcu_assign_pointer(per_cpu(cpufreq_update_util_data, cpu), NULL); | ||
} | ||
EXPORT_SYMBOL_GPL(cpufreq_remove_update_util_hook); | ||
|
||
/** | ||
* cpufreq_this_cpu_can_update - Check if cpufreq policy can be updated. | ||
* @policy: cpufreq policy to check. | ||
* | ||
* Return 'true' if: | ||
* - the local and remote CPUs share @policy, | ||
* - dvfs_possible_from_any_cpu is set in @policy and the local CPU is not going | ||
* offline (in which case it is not expected to run cpufreq updates any more). | ||
*/ | ||
bool cpufreq_this_cpu_can_update(struct cpufreq_policy *policy) | ||
{ | ||
return cpumask_test_cpu(smp_processor_id(), policy->cpus) || | ||
(policy->dvfs_possible_from_any_cpu && | ||
rcu_dereference_sched(*this_cpu_ptr(&cpufreq_update_util_data))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters