diff options
| author | Lifeng Zheng <zhenglifeng1@huawei.com> | 2025-11-19 11:13:55 +0300 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-01-06 00:11:48 +0300 |
| commit | 4221504c4328d4d9e57962bf530fa52913591139 (patch) | |
| tree | 7a640b4a4a83352d0ea0b062ad60491dba417104 /include/linux | |
| parent | af15bc259e260cbe5221c220d56a716b6facf155 (diff) | |
| download | linux-4221504c4328d4d9e57962bf530fa52913591139.tar.xz | |
cpufreq: Add new helper function returning cpufreq policy
cpufreq_cpu_get_raw() gets cpufreq policy only if the CPU is in
policy->cpus mask, which means the CPU is already online. But in some
cases, the policy is needed before the CPU is added to cpus mask. Add a
function to get the policy in these cases.
Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Reviewed-by: Jie Zhan <zhanjie9@hisilicon.com>
Acked-by: Beata Michalska <beata.michalska@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cpufreq.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 0465d1e6f72a..cc894fc38971 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -203,6 +203,7 @@ struct cpufreq_freqs { #ifdef CONFIG_CPU_FREQ struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu); +struct cpufreq_policy *cpufreq_cpu_policy(unsigned int cpu); struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); void cpufreq_cpu_put(struct cpufreq_policy *policy); #else @@ -210,6 +211,10 @@ static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu) { return NULL; } +static inline struct cpufreq_policy *cpufreq_cpu_policy(unsigned int cpu) +{ + return NULL; +} static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) { return NULL; |
