Skip to content

Commit

Permalink
soc: msm_performance: limit max cpu frequencies for both clusters
Browse files Browse the repository at this point in the history
* To decrease energy consumption, the max freq of all CPUs
  is limited to 1,344 / 1,536 GHz per cluster respectively.
  • Loading branch information
Tommy-Geenexus authored and zachariasmaladroit committed May 12, 2016
1 parent d864fae commit 1bd4d7b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/soc/qcom/msm_performance.c
Expand Up @@ -137,6 +137,9 @@ static struct task_struct *notify_thread;
#define DEF_MULTI_EXIT_CYCLE 4
#define LAST_LD_CHECK_TOL (2 * USEC_PER_MSEC)

#define CLUSTER_0_FREQ_CAP 1344000
#define CLUSTER_1_FREQ_CAP 1536000

/**************************sysfs start********************************/

static int set_num_clusters(const char *buf, const struct kernel_param *kp)
Expand Down Expand Up @@ -1942,8 +1945,13 @@ static int __init msm_performance_init(void)
cpufreq_register_notifier(&perf_cpufreq_nb, CPUFREQ_POLICY_NOTIFIER);
cpufreq_register_notifier(&perf_govinfo_nb, CPUFREQ_GOVINFO_NOTIFIER);

for_each_present_cpu(cpu)
per_cpu(cpu_stats, cpu).max = UINT_MAX;
/* Cap max cpu freq individually for each cluster */
for_each_present_cpu(cpu) {
if (topology_physical_package_id(cpu) == 0)
per_cpu(cpu_stats, cpu).max = CLUSTER_0_FREQ_CAP;
else if (topology_physical_package_id(cpu) == 1)
per_cpu(cpu_stats, cpu).max = CLUSTER_1_FREQ_CAP;
}

register_cpu_notifier(&msm_performance_cpu_notifier);

Expand Down

0 comments on commit 1bd4d7b

Please sign in to comment.