Loading drivers/cpufreq/qcom-cpufreq.c +2 −23 Original line number Diff line number Diff line /* arch/arm/mach-msm/cpufreq.c /* drivers/cpufreq/qcom-cpufreq.c * * MSM architecture cpufreq driver * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2014, The Linux Foundation. All rights reserved. * Copyright (c) 2007-2015, The Linux Foundation. All rights reserved. * Author: Mike A. Chan <mikechan@google.com> * * This software is licensed under the terms of the GNU General Public Loading @@ -22,8 +22,6 @@ #include <linux/cpufreq.h> #include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/sched.h> #include <linux/sched/rt.h> #include <linux/suspend.h> #include <linux/clk.h> #include <linux/err.h> Loading @@ -49,27 +47,13 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq, unsigned int index) { int ret = 0; int saved_sched_policy = -EINVAL; int saved_sched_rt_prio = -EINVAL; struct cpufreq_freqs freqs; struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; unsigned long rate; freqs.old = policy->cur; freqs.new = new_freq; freqs.cpu = policy->cpu; /* * Put the caller into SCHED_FIFO priority to avoid cpu starvation * while increasing frequencies */ if (freqs.new > freqs.old && current->policy != SCHED_FIFO) { saved_sched_policy = current->policy; saved_sched_rt_prio = current->rt_priority; sched_setscheduler_nocheck(current, SCHED_FIFO, ¶m); } cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); trace_cpu_frequency_switch_start(freqs.old, freqs.new, policy->cpu); Loading @@ -82,11 +66,6 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq, trace_cpu_frequency_switch_end(policy->cpu); } /* Restore priority after clock ramp-up */ if (freqs.new > freqs.old && saved_sched_policy >= 0) { param.sched_priority = saved_sched_rt_prio; sched_setscheduler_nocheck(current, saved_sched_policy, ¶m); } return ret; } Loading Loading
drivers/cpufreq/qcom-cpufreq.c +2 −23 Original line number Diff line number Diff line /* arch/arm/mach-msm/cpufreq.c /* drivers/cpufreq/qcom-cpufreq.c * * MSM architecture cpufreq driver * * Copyright (C) 2007 Google, Inc. * Copyright (c) 2007-2014, The Linux Foundation. All rights reserved. * Copyright (c) 2007-2015, The Linux Foundation. All rights reserved. * Author: Mike A. Chan <mikechan@google.com> * * This software is licensed under the terms of the GNU General Public Loading @@ -22,8 +22,6 @@ #include <linux/cpufreq.h> #include <linux/cpu.h> #include <linux/cpumask.h> #include <linux/sched.h> #include <linux/sched/rt.h> #include <linux/suspend.h> #include <linux/clk.h> #include <linux/err.h> Loading @@ -49,27 +47,13 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq, unsigned int index) { int ret = 0; int saved_sched_policy = -EINVAL; int saved_sched_rt_prio = -EINVAL; struct cpufreq_freqs freqs; struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; unsigned long rate; freqs.old = policy->cur; freqs.new = new_freq; freqs.cpu = policy->cpu; /* * Put the caller into SCHED_FIFO priority to avoid cpu starvation * while increasing frequencies */ if (freqs.new > freqs.old && current->policy != SCHED_FIFO) { saved_sched_policy = current->policy; saved_sched_rt_prio = current->rt_priority; sched_setscheduler_nocheck(current, SCHED_FIFO, ¶m); } cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); trace_cpu_frequency_switch_start(freqs.old, freqs.new, policy->cpu); Loading @@ -82,11 +66,6 @@ static int set_cpu_freq(struct cpufreq_policy *policy, unsigned int new_freq, trace_cpu_frequency_switch_end(policy->cpu); } /* Restore priority after clock ramp-up */ if (freqs.new > freqs.old && saved_sched_policy >= 0) { param.sched_priority = saved_sched_rt_prio; sched_setscheduler_nocheck(current, saved_sched_policy, ¶m); } return ret; } Loading