diff options
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 5f40522ec98c..537ff842ff73 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -127,6 +127,15 @@ struct cpufreq_policy { | |||
127 | */ | 127 | */ |
128 | unsigned int transition_delay_us; | 128 | unsigned int transition_delay_us; |
129 | 129 | ||
130 | /* | ||
131 | * Remote DVFS flag (Not added to the driver structure as we don't want | ||
132 | * to access another structure from scheduler hotpath). | ||
133 | * | ||
134 | * Should be set if CPUs can do DVFS on behalf of other CPUs from | ||
135 | * different cpufreq policies. | ||
136 | */ | ||
137 | bool dvfs_possible_from_any_cpu; | ||
138 | |||
130 | /* Cached frequency lookup from cpufreq_driver_resolve_freq. */ | 139 | /* Cached frequency lookup from cpufreq_driver_resolve_freq. */ |
131 | unsigned int cached_target_freq; | 140 | unsigned int cached_target_freq; |
132 | int cached_resolved_idx; | 141 | int cached_resolved_idx; |
@@ -562,6 +571,17 @@ struct governor_attr { | |||
562 | size_t count); | 571 | size_t count); |
563 | }; | 572 | }; |
564 | 573 | ||
574 | static inline bool cpufreq_can_do_remote_dvfs(struct cpufreq_policy *policy) | ||
575 | { | ||
576 | /* | ||
577 | * Allow remote callbacks if: | ||
578 | * - dvfs_possible_from_any_cpu flag is set | ||
579 | * - the local and remote CPUs share cpufreq policy | ||
580 | */ | ||
581 | return policy->dvfs_possible_from_any_cpu || | ||
582 | cpumask_test_cpu(smp_processor_id(), policy->cpus); | ||
583 | } | ||
584 | |||
565 | /********************************************************************* | 585 | /********************************************************************* |
566 | * FREQUENCY TABLE HELPERS * | 586 | * FREQUENCY TABLE HELPERS * |
567 | *********************************************************************/ | 587 | *********************************************************************/ |