From 244fb879c49441ce97534f141c4719d817fd82eb Mon Sep 17 00:00:00 2001 From: Youngtae Lee Date: Mon, 14 May 2018 11:08:23 +0900 Subject: [PATCH] samsung: emc: change real frequency check function. Use acme driver old frequency or real cmu value instead of policy->cur Change-Id: Ide22cf698d0177bcebdba45d980886124ee3c74f Signed-off-by: Youngtae Lee --- drivers/soc/samsung/exynos-emc.c | 17 +++++++---------- include/soc/samsung/exynos-emc.h | 2 ++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/soc/samsung/exynos-emc.c b/drivers/soc/samsung/exynos-emc.c index 55ca20125f80..47ab39a08ce3 100644 --- a/drivers/soc/samsung/exynos-emc.c +++ b/drivers/soc/samsung/exynos-emc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -203,13 +204,11 @@ int emc_verify_constraints(struct cpumask *mask) { struct cpufreq_policy *policy; struct emc_mode *mode; - struct cpumask temp; - int cpu; + unsigned int cpu; /* find mode matched mask */ mode = emc_find_mode(mask); - cpumask_and(&temp, &mode->boost_cpus, cpu_online_mask); - cpu = cpumask_first(&temp); + cpu = cpumask_first(&mode->boost_cpus); policy = cpufreq_cpu_get(cpu); if (!policy) { @@ -224,15 +223,13 @@ int emc_verify_constraints(struct cpumask *mask) mode->name, mode->max_freq, policy->max); return 0; } + cpufreq_cpu_put(policy); check_real_freq: /* check whether real cpu freq within max constraints or not */ - if (cpufreq_get(cpu) > mode->max_freq) { - panic("EMC(%s): real frequency is higher than max\n", __func__); - return 0; - } - - cpufreq_cpu_put(policy); + if (exynos_cpufreq_get(cpu) > mode->max_freq) + panic("EMC(%s): real frequency(%d) is higher than max(%d)\n", + __func__, exynos_cpufreq_get(cpu), mode->max_freq); return 1; } diff --git a/include/soc/samsung/exynos-emc.h b/include/soc/samsung/exynos-emc.h index 15812fba3307..a4b9a80bb8c3 100644 --- a/include/soc/samsung/exynos-emc.h +++ b/include/soc/samsung/exynos-emc.h @@ -24,5 +24,7 @@ static inline int emc_get_boost_freq(int cpu) { return 0; }; static inline void emc_check_available_freq(struct cpumask *cpus, unsigned int target_freq) { return; }; #endif +unsigned int exynos_cpufreq_get(unsigned int cpu); + #endif /* __EXYNOS_MODE_CHANGER_H */ -- 2.20.1