diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-08-14 10:08:24 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-30 19:11:08 -0400 |
commit | d4019f0a92ab802f385cc9c8ad3ab7b5449712cb (patch) | |
tree | ebd06695585e457ae1bf219653452b111e7508db /drivers/cpufreq/ia64-acpi-cpufreq.c | |
parent | 7dbf694db6ac7c759599316d50d7050efcbd512a (diff) |
cpufreq: move freq change notifications to cpufreq core
Most of the drivers do following in their ->target_index() routines:
struct cpufreq_freqs freqs;
freqs.old = old freq...
freqs.new = new freq...
cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
/* Change rate here */
cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
This is replicated over all cpufreq drivers today and there doesn't exists a
good enough reason why this shouldn't be moved to cpufreq core instead.
There are few special cases though, like exynos5440, which doesn't do everything
on the call to ->target_index() routine and call some kind of bottom halves for
doing this work, work/tasklet/etc..
They may continue doing notification from their own code as flag:
CPUFREQ_ASYNC_NOTIFICATION is already set for them.
All drivers are also modified in this patch to avoid breaking 'git bisect', as
double notification would happen otherwise.
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Russell King <linux@arm.linux.org.uk>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/ia64-acpi-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/ia64-acpi-cpufreq.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c index 4695fa22406a..53c6ac637e10 100644 --- a/drivers/cpufreq/ia64-acpi-cpufreq.c +++ b/drivers/cpufreq/ia64-acpi-cpufreq.c | |||
@@ -141,7 +141,6 @@ processor_set_freq ( | |||
141 | { | 141 | { |
142 | int ret = 0; | 142 | int ret = 0; |
143 | u32 value = 0; | 143 | u32 value = 0; |
144 | struct cpufreq_freqs cpufreq_freqs; | ||
145 | cpumask_t saved_mask; | 144 | cpumask_t saved_mask; |
146 | int retval; | 145 | int retval; |
147 | 146 | ||
@@ -168,13 +167,6 @@ processor_set_freq ( | |||
168 | pr_debug("Transitioning from P%d to P%d\n", | 167 | pr_debug("Transitioning from P%d to P%d\n", |
169 | data->acpi_data.state, state); | 168 | data->acpi_data.state, state); |
170 | 169 | ||
171 | /* cpufreq frequency struct */ | ||
172 | cpufreq_freqs.old = data->freq_table[data->acpi_data.state].frequency; | ||
173 | cpufreq_freqs.new = data->freq_table[state].frequency; | ||
174 | |||
175 | /* notify cpufreq */ | ||
176 | cpufreq_notify_transition(policy, &cpufreq_freqs, CPUFREQ_PRECHANGE); | ||
177 | |||
178 | /* | 170 | /* |
179 | * First we write the target state's 'control' value to the | 171 | * First we write the target state's 'control' value to the |
180 | * control_register. | 172 | * control_register. |
@@ -186,22 +178,11 @@ processor_set_freq ( | |||
186 | 178 | ||
187 | ret = processor_set_pstate(value); | 179 | ret = processor_set_pstate(value); |
188 | if (ret) { | 180 | if (ret) { |
189 | unsigned int tmp = cpufreq_freqs.new; | ||
190 | cpufreq_notify_transition(policy, &cpufreq_freqs, | ||
191 | CPUFREQ_POSTCHANGE); | ||
192 | cpufreq_freqs.new = cpufreq_freqs.old; | ||
193 | cpufreq_freqs.old = tmp; | ||
194 | cpufreq_notify_transition(policy, &cpufreq_freqs, | ||
195 | CPUFREQ_PRECHANGE); | ||
196 | cpufreq_notify_transition(policy, &cpufreq_freqs, | ||
197 | CPUFREQ_POSTCHANGE); | ||
198 | printk(KERN_WARNING "Transition failed with error %d\n", ret); | 181 | printk(KERN_WARNING "Transition failed with error %d\n", ret); |
199 | retval = -ENODEV; | 182 | retval = -ENODEV; |
200 | goto migrate_end; | 183 | goto migrate_end; |
201 | } | 184 | } |
202 | 185 | ||
203 | cpufreq_notify_transition(policy, &cpufreq_freqs, CPUFREQ_POSTCHANGE); | ||
204 | |||
205 | data->acpi_data.state = state; | 186 | data->acpi_data.state = state; |
206 | 187 | ||
207 | retval = 0; | 188 | retval = 0; |