Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d6d479b authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm: rq_stats: Use cpufreq API to get the current frequency



Since the acpuclock APIs are deprecated, use the cpufreq to
get the current frequency of CPUs to calculate the cpu
normalized load value.

Change-Id: I6e381d584d6725ef964bad86c835d44f3046e9c3
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 678adbd0
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@
#include <linux/kernel_stat.h>
#include <linux/kernel_stat.h>
#include <linux/tick.h>
#include <linux/tick.h>
#include <asm/smp_plat.h>
#include <asm/smp_plat.h>
#include "acpuclock.h"
#include <linux/suspend.h>
#include <linux/suspend.h>


#define MAX_LONG_SIZE 24
#define MAX_LONG_SIZE 24
@@ -177,7 +176,7 @@ static int cpu_hotplug_handler(struct notifier_block *nb,
	switch (val) {
	switch (val) {
	case CPU_ONLINE:
	case CPU_ONLINE:
		if (!this_cpu->cur_freq)
		if (!this_cpu->cur_freq)
			this_cpu->cur_freq = acpuclk_get_rate(cpu);
			this_cpu->cur_freq = cpufreq_quick_get(cpu) * 1000;
		update_related_cpus();
		update_related_cpus();
	case CPU_ONLINE_FROZEN:
	case CPU_ONLINE_FROZEN:
		this_cpu->avg_load_maxfreq = 0;
		this_cpu->avg_load_maxfreq = 0;
@@ -381,7 +380,7 @@ static int __init msm_rq_stats_init(void)
		cpufreq_get_policy(&cpu_policy, i);
		cpufreq_get_policy(&cpu_policy, i);
		pcpu->policy_max = cpu_policy.cpuinfo.max_freq;
		pcpu->policy_max = cpu_policy.cpuinfo.max_freq;
		if (cpu_online(i))
		if (cpu_online(i))
			pcpu->cur_freq = acpuclk_get_rate(i);
			pcpu->cur_freq = cpufreq_quick_get(i) * 1000;
		cpumask_copy(pcpu->related_cpus, cpu_policy.cpus);
		cpumask_copy(pcpu->related_cpus, cpu_policy.cpus);
	}
	}
	freq_transition.notifier_call = cpufreq_transition_handler;
	freq_transition.notifier_call = cpufreq_transition_handler;