From: Lukasz Luba Date: Tue, 6 Nov 2018 16:45:49 +0000 (+0100) Subject: thermal: cpu_cooling: add function which copies cpumask X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=607269531345332461906823bc4f10cfee77ece5;p=platform%2Fkernel%2Flinux-exynos.git thermal: cpu_cooling: add function which copies cpumask The patch add fnction which provides information which CPUs are pinned to the related cpufreq cooling device. Signed-off-by: Lukasz Luba --- diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 0360cdd0826b..f27f1636803c 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -755,6 +755,22 @@ bool cpufreq_cooling_test_related_cpu(struct thermal_cooling_device *cdev, } EXPORT_SYMBOL_GPL(cpufreq_cooling_test_related_cpu); +void cpufreq_cooling_copy_cpumask(struct thermal_cooling_device *cdev, + struct cpumask *dstmask) +{ + struct cpufreq_cooling_device *cpufreq_cdev; + struct cpufreq_policy *policy; + + if (cdev && cdev->devdata) { + cpufreq_cdev = cdev->devdata; + if (cpufreq_cdev->policy) { + policy = cpufreq_cdev->policy; + cpumask_copy(dstmask, policy->related_cpus); + } + } +} +EXPORT_SYMBOL_GPL(cpufreq_cooling_copy_cpumask); + /** * of_cpufreq_cooling_register - function to create cpufreq cooling device. * @policy: cpufreq policy diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h index ea609f7bdf55..fee20e0a5fed 100644 --- a/include/linux/cpu_cooling.h +++ b/include/linux/cpu_cooling.h @@ -50,6 +50,9 @@ bool cpufreq_cooling_test_related_cpu(struct thermal_cooling_device *cdev, struct cpumask *cpufreq_cooling_get_related_cpumask(struct thermal_cooling_device *cdev); +void cpufreq_cooling_copy_cpumask(struct thermal_cooling_device *cdev, + struct cpumask *dstmask); + #else /* !CONFIG_CPU_THERMAL */ static inline struct thermal_cooling_device * cpufreq_cooling_register(struct cpufreq_policy *policy) @@ -75,6 +78,9 @@ struct cpumask { return NULL; } + +void cpufreq_cooling_copy_cpumask(struct thermal_cooling_device *cdev, + struct cpumask *dstmask) {} #endif /* CONFIG_CPU_THERMAL */ #if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL)