From 8dd074473fee6c437fb3589ff4a78a8ce19ac514 Mon Sep 17 00:00:00 2001 From: Soohyun Kim Date: Wed, 28 Mar 2018 00:09:33 +0900 Subject: [PATCH] [COMMON] cpufreq: acme: add online check about domain cpus. Change-Id: Id7fc67da1f4c0500dac03f944e061a2844fc479f Signed-off-by: Soohyun Kim --- drivers/cpufreq/exynos-acme.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/cpufreq/exynos-acme.c b/drivers/cpufreq/exynos-acme.c index c65985026e15..a8ef02ecb0bc 100644 --- a/drivers/cpufreq/exynos-acme.c +++ b/drivers/cpufreq/exynos-acme.c @@ -613,6 +613,8 @@ static int exynos_cpufreq_pm_qos_callback(struct notifier_block *nb, { int pm_qos_class = *((int *)v); struct exynos_cpufreq_domain *domain; + struct cpufreq_policy *policy; + struct cpumask mask; int ret; pr_debug("update PM QoS class %d to %ld kHz\n", pm_qos_class, val); @@ -621,6 +623,14 @@ static int exynos_cpufreq_pm_qos_callback(struct notifier_block *nb, if (!domain) return NOTIFY_BAD; + cpumask_and(&mask, &domain->cpus, cpu_online_mask); + if (cpumask_empty(&mask)) + return NOTIFY_BAD; + + policy = cpufreq_cpu_get(cpumask_first(&mask)); + if (!policy) + return NOTIFY_BAD; + update_dm_constraint(domain, NULL); ret = need_update_freq(domain, pm_qos_class, val); -- 2.20.1