diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-03-24 04:05:45 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-03-26 11:41:41 -0400 |
commit | 8fec051eea736ec1d8060a2c8766bf3a6b32c3d2 (patch) | |
tree | a771379f2f9c127e8543d43b9b70f86e917211ea /drivers | |
parent | 12478cf0c55e5969f740bb38a24b1a0104ae18d8 (diff) |
cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end}
CPUFreq core has new infrastructure that would guarantee serialized calls to
target() or target_index() callbacks. These are called
cpufreq_freq_transition_begin() and cpufreq_freq_transition_end().
This patch converts existing drivers to use these new set of routines.
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.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')
-rw-r--r-- | drivers/cpufreq/cpufreq-nforce2.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 9 | ||||
-rw-r--r-- | drivers/cpufreq/exynos5440-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/gx-suspmod.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/integrator-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/longhaul.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/pcc-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k6.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k7.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k8.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/s3c24xx-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/sh-cpufreq.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/unicore2-cpufreq.c | 4 |
13 files changed, 28 insertions, 29 deletions
diff --git a/drivers/cpufreq/cpufreq-nforce2.c b/drivers/cpufreq/cpufreq-nforce2.c index a05b876f375e..bc447b9003c3 100644 --- a/drivers/cpufreq/cpufreq-nforce2.c +++ b/drivers/cpufreq/cpufreq-nforce2.c | |||
@@ -270,7 +270,7 @@ static int nforce2_target(struct cpufreq_policy *policy, | |||
270 | pr_debug("Old CPU frequency %d kHz, new %d kHz\n", | 270 | pr_debug("Old CPU frequency %d kHz, new %d kHz\n", |
271 | freqs.old, freqs.new); | 271 | freqs.old, freqs.new); |
272 | 272 | ||
273 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 273 | cpufreq_freq_transition_begin(policy, &freqs); |
274 | 274 | ||
275 | /* Disable IRQs */ | 275 | /* Disable IRQs */ |
276 | /* local_irq_save(flags); */ | 276 | /* local_irq_save(flags); */ |
@@ -285,7 +285,7 @@ static int nforce2_target(struct cpufreq_policy *policy, | |||
285 | /* Enable IRQs */ | 285 | /* Enable IRQs */ |
286 | /* local_irq_restore(flags); */ | 286 | /* local_irq_restore(flags); */ |
287 | 287 | ||
288 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 288 | cpufreq_freq_transition_end(policy, &freqs, 0); |
289 | 289 | ||
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d57806a85def..eb562d043412 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1507,8 +1507,8 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq, | |||
1507 | policy = per_cpu(cpufreq_cpu_data, cpu); | 1507 | policy = per_cpu(cpufreq_cpu_data, cpu); |
1508 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1508 | read_unlock_irqrestore(&cpufreq_driver_lock, flags); |
1509 | 1509 | ||
1510 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 1510 | cpufreq_freq_transition_begin(policy, &freqs); |
1511 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 1511 | cpufreq_freq_transition_end(policy, &freqs, 0); |
1512 | } | 1512 | } |
1513 | 1513 | ||
1514 | /** | 1514 | /** |
@@ -1868,8 +1868,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1868 | pr_debug("%s: cpu: %d, oldfreq: %u, new freq: %u\n", | 1868 | pr_debug("%s: cpu: %d, oldfreq: %u, new freq: %u\n", |
1869 | __func__, policy->cpu, freqs.old, freqs.new); | 1869 | __func__, policy->cpu, freqs.old, freqs.new); |
1870 | 1870 | ||
1871 | cpufreq_notify_transition(policy, &freqs, | 1871 | cpufreq_freq_transition_begin(policy, &freqs); |
1872 | CPUFREQ_PRECHANGE); | ||
1873 | } | 1872 | } |
1874 | 1873 | ||
1875 | retval = cpufreq_driver->target_index(policy, index); | 1874 | retval = cpufreq_driver->target_index(policy, index); |
@@ -1878,7 +1877,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
1878 | __func__, retval); | 1877 | __func__, retval); |
1879 | 1878 | ||
1880 | if (notify) | 1879 | if (notify) |
1881 | cpufreq_notify_post_transition(policy, &freqs, retval); | 1880 | cpufreq_freq_transition_end(policy, &freqs, retval); |
1882 | } | 1881 | } |
1883 | 1882 | ||
1884 | out: | 1883 | out: |
diff --git a/drivers/cpufreq/exynos5440-cpufreq.c b/drivers/cpufreq/exynos5440-cpufreq.c index 7f776aa91e2f..a6b8214d7b77 100644 --- a/drivers/cpufreq/exynos5440-cpufreq.c +++ b/drivers/cpufreq/exynos5440-cpufreq.c | |||
@@ -219,7 +219,7 @@ static int exynos_target(struct cpufreq_policy *policy, unsigned int index) | |||
219 | freqs.old = policy->cur; | 219 | freqs.old = policy->cur; |
220 | freqs.new = freq_table[index].frequency; | 220 | freqs.new = freq_table[index].frequency; |
221 | 221 | ||
222 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 222 | cpufreq_freq_transition_begin(policy, &freqs); |
223 | 223 | ||
224 | /* Set the target frequency in all C0_3_PSTATE register */ | 224 | /* Set the target frequency in all C0_3_PSTATE register */ |
225 | for_each_cpu(i, policy->cpus) { | 225 | for_each_cpu(i, policy->cpus) { |
@@ -258,7 +258,7 @@ static void exynos_cpufreq_work(struct work_struct *work) | |||
258 | dev_crit(dvfs_info->dev, "New frequency out of range\n"); | 258 | dev_crit(dvfs_info->dev, "New frequency out of range\n"); |
259 | freqs.new = freqs.old; | 259 | freqs.new = freqs.old; |
260 | } | 260 | } |
261 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 261 | cpufreq_freq_transition_end(policy, &freqs, 0); |
262 | 262 | ||
263 | cpufreq_cpu_put(policy); | 263 | cpufreq_cpu_put(policy); |
264 | mutex_unlock(&cpufreq_lock); | 264 | mutex_unlock(&cpufreq_lock); |
diff --git a/drivers/cpufreq/gx-suspmod.c b/drivers/cpufreq/gx-suspmod.c index d83e8266a58e..1d723dc8880c 100644 --- a/drivers/cpufreq/gx-suspmod.c +++ b/drivers/cpufreq/gx-suspmod.c | |||
@@ -265,7 +265,7 @@ static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz) | |||
265 | 265 | ||
266 | freqs.new = new_khz; | 266 | freqs.new = new_khz; |
267 | 267 | ||
268 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 268 | cpufreq_freq_transition_begin(policy, &freqs); |
269 | local_irq_save(flags); | 269 | local_irq_save(flags); |
270 | 270 | ||
271 | if (new_khz != stock_freq) { | 271 | if (new_khz != stock_freq) { |
@@ -314,7 +314,7 @@ static void gx_set_cpuspeed(struct cpufreq_policy *policy, unsigned int khz) | |||
314 | 314 | ||
315 | gx_params->pci_suscfg = suscfg; | 315 | gx_params->pci_suscfg = suscfg; |
316 | 316 | ||
317 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 317 | cpufreq_freq_transition_end(policy, &freqs, 0); |
318 | 318 | ||
319 | pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n", | 319 | pr_debug("suspend modulation w/ duration of ON:%d us, OFF:%d us\n", |
320 | gx_params->on_duration * 32, gx_params->off_duration * 32); | 320 | gx_params->on_duration * 32, gx_params->off_duration * 32); |
diff --git a/drivers/cpufreq/integrator-cpufreq.c b/drivers/cpufreq/integrator-cpufreq.c index 0e27844e8c2d..e5122f1bfe78 100644 --- a/drivers/cpufreq/integrator-cpufreq.c +++ b/drivers/cpufreq/integrator-cpufreq.c | |||
@@ -122,7 +122,7 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 125 | cpufreq_freq_transition_begin(policy, &freqs); |
126 | 126 | ||
127 | cm_osc = __raw_readl(cm_base + INTEGRATOR_HDR_OSC_OFFSET); | 127 | cm_osc = __raw_readl(cm_base + INTEGRATOR_HDR_OSC_OFFSET); |
128 | 128 | ||
@@ -143,7 +143,7 @@ static int integrator_set_target(struct cpufreq_policy *policy, | |||
143 | */ | 143 | */ |
144 | set_cpus_allowed(current, cpus_allowed); | 144 | set_cpus_allowed(current, cpus_allowed); |
145 | 145 | ||
146 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 146 | cpufreq_freq_transition_end(policy, &freqs, 0); |
147 | 147 | ||
148 | return 0; | 148 | return 0; |
149 | } | 149 | } |
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 7b94da3d2d10..5c440f87ba8a 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c | |||
@@ -269,7 +269,7 @@ static void longhaul_setstate(struct cpufreq_policy *policy, | |||
269 | freqs.old = calc_speed(longhaul_get_cpu_mult()); | 269 | freqs.old = calc_speed(longhaul_get_cpu_mult()); |
270 | freqs.new = speed; | 270 | freqs.new = speed; |
271 | 271 | ||
272 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 272 | cpufreq_freq_transition_begin(policy, &freqs); |
273 | 273 | ||
274 | pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", | 274 | pr_debug("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", |
275 | fsb, mult/10, mult%10, print_speed(speed/1000)); | 275 | fsb, mult/10, mult%10, print_speed(speed/1000)); |
@@ -386,7 +386,7 @@ retry_loop: | |||
386 | } | 386 | } |
387 | } | 387 | } |
388 | /* Report true CPU frequency */ | 388 | /* Report true CPU frequency */ |
389 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 389 | cpufreq_freq_transition_end(policy, &freqs, 0); |
390 | 390 | ||
391 | if (!bm_timeout) | 391 | if (!bm_timeout) |
392 | printk(KERN_INFO PFX "Warning: Timeout while waiting for " | 392 | printk(KERN_INFO PFX "Warning: Timeout while waiting for " |
diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c index 1c0f1067af73..728a2d879499 100644 --- a/drivers/cpufreq/pcc-cpufreq.c +++ b/drivers/cpufreq/pcc-cpufreq.c | |||
@@ -215,7 +215,7 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, | |||
215 | 215 | ||
216 | freqs.old = policy->cur; | 216 | freqs.old = policy->cur; |
217 | freqs.new = target_freq; | 217 | freqs.new = target_freq; |
218 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 218 | cpufreq_freq_transition_begin(policy, &freqs); |
219 | 219 | ||
220 | input_buffer = 0x1 | (((target_freq * 100) | 220 | input_buffer = 0x1 | (((target_freq * 100) |
221 | / (ioread32(&pcch_hdr->nominal) * 1000)) << 8); | 221 | / (ioread32(&pcch_hdr->nominal) * 1000)) << 8); |
@@ -231,7 +231,7 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy, | |||
231 | status = ioread16(&pcch_hdr->status); | 231 | status = ioread16(&pcch_hdr->status); |
232 | iowrite16(0, &pcch_hdr->status); | 232 | iowrite16(0, &pcch_hdr->status); |
233 | 233 | ||
234 | cpufreq_notify_post_transition(policy, &freqs, status != CMD_COMPLETE); | 234 | cpufreq_freq_transition_end(policy, &freqs, status != CMD_COMPLETE); |
235 | spin_unlock(&pcc_lock); | 235 | spin_unlock(&pcc_lock); |
236 | 236 | ||
237 | if (status != CMD_COMPLETE) { | 237 | if (status != CMD_COMPLETE) { |
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c index ce27e6c26c94..62c6f2e5afce 100644 --- a/drivers/cpufreq/powernow-k6.c +++ b/drivers/cpufreq/powernow-k6.c | |||
@@ -148,11 +148,11 @@ static int powernow_k6_target(struct cpufreq_policy *policy, | |||
148 | freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); | 148 | freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); |
149 | freqs.new = busfreq * clock_ratio[best_i].driver_data; | 149 | freqs.new = busfreq * clock_ratio[best_i].driver_data; |
150 | 150 | ||
151 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 151 | cpufreq_freq_transition_begin(policy, &freqs); |
152 | 152 | ||
153 | powernow_k6_set_cpu_multiplier(best_i); | 153 | powernow_k6_set_cpu_multiplier(best_i); |
154 | 154 | ||
155 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 155 | cpufreq_freq_transition_end(policy, &freqs, 0); |
156 | 156 | ||
157 | return 0; | 157 | return 0; |
158 | } | 158 | } |
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 0e68e0275621..f911645c3f6d 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c | |||
@@ -269,7 +269,7 @@ static int powernow_target(struct cpufreq_policy *policy, unsigned int index) | |||
269 | 269 | ||
270 | freqs.new = powernow_table[index].frequency; | 270 | freqs.new = powernow_table[index].frequency; |
271 | 271 | ||
272 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 272 | cpufreq_freq_transition_begin(policy, &freqs); |
273 | 273 | ||
274 | /* Now do the magic poking into the MSRs. */ | 274 | /* Now do the magic poking into the MSRs. */ |
275 | 275 | ||
@@ -290,7 +290,7 @@ static int powernow_target(struct cpufreq_policy *policy, unsigned int index) | |||
290 | if (have_a0 == 1) | 290 | if (have_a0 == 1) |
291 | local_irq_enable(); | 291 | local_irq_enable(); |
292 | 292 | ||
293 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 293 | cpufreq_freq_transition_end(policy, &freqs, 0); |
294 | 294 | ||
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 27eb2be44de5..770a9e1b3468 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
@@ -963,9 +963,9 @@ static int transition_frequency_fidvid(struct powernow_k8_data *data, | |||
963 | policy = cpufreq_cpu_get(smp_processor_id()); | 963 | policy = cpufreq_cpu_get(smp_processor_id()); |
964 | cpufreq_cpu_put(policy); | 964 | cpufreq_cpu_put(policy); |
965 | 965 | ||
966 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 966 | cpufreq_freq_transition_begin(policy, &freqs); |
967 | res = transition_fid_vid(data, fid, vid); | 967 | res = transition_fid_vid(data, fid, vid); |
968 | cpufreq_notify_post_transition(policy, &freqs, res); | 968 | cpufreq_freq_transition_end(policy, &freqs, res); |
969 | 969 | ||
970 | return res; | 970 | return res; |
971 | } | 971 | } |
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index 25069741b507..a3dc192d21f9 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c | |||
@@ -217,7 +217,7 @@ static int s3c_cpufreq_settarget(struct cpufreq_policy *policy, | |||
217 | s3c_cpufreq_updateclk(clk_pclk, cpu_new.freq.pclk); | 217 | s3c_cpufreq_updateclk(clk_pclk, cpu_new.freq.pclk); |
218 | 218 | ||
219 | /* start the frequency change */ | 219 | /* start the frequency change */ |
220 | cpufreq_notify_transition(policy, &freqs.freqs, CPUFREQ_PRECHANGE); | 220 | cpufreq_freq_transition_begin(policy, &freqs.freqs); |
221 | 221 | ||
222 | /* If hclk is staying the same, then we do not need to | 222 | /* If hclk is staying the same, then we do not need to |
223 | * re-write the IO or the refresh timings whilst we are changing | 223 | * re-write the IO or the refresh timings whilst we are changing |
@@ -261,7 +261,7 @@ static int s3c_cpufreq_settarget(struct cpufreq_policy *policy, | |||
261 | local_irq_restore(flags); | 261 | local_irq_restore(flags); |
262 | 262 | ||
263 | /* notify everyone we've done this */ | 263 | /* notify everyone we've done this */ |
264 | cpufreq_notify_transition(policy, &freqs.freqs, CPUFREQ_POSTCHANGE); | 264 | cpufreq_freq_transition_end(policy, &freqs.freqs, 0); |
265 | 265 | ||
266 | s3c_freq_dbg("%s: finished\n", __func__); | 266 | s3c_freq_dbg("%s: finished\n", __func__); |
267 | return 0; | 267 | return 0; |
diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index 696170ebd3a3..86628e22b2a3 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c | |||
@@ -68,10 +68,10 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy, | |||
68 | freqs.new = (freq + 500) / 1000; | 68 | freqs.new = (freq + 500) / 1000; |
69 | freqs.flags = 0; | 69 | freqs.flags = 0; |
70 | 70 | ||
71 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 71 | cpufreq_freq_transition_begin(policy, &freqs); |
72 | set_cpus_allowed_ptr(current, &cpus_allowed); | 72 | set_cpus_allowed_ptr(current, &cpus_allowed); |
73 | clk_set_rate(cpuclk, freq); | 73 | clk_set_rate(cpuclk, freq); |
74 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); | 74 | cpufreq_freq_transition_end(policy, &freqs, 0); |
75 | 75 | ||
76 | dev_dbg(dev, "set frequency %lu Hz\n", freq); | 76 | dev_dbg(dev, "set frequency %lu Hz\n", freq); |
77 | 77 | ||
diff --git a/drivers/cpufreq/unicore2-cpufreq.c b/drivers/cpufreq/unicore2-cpufreq.c index 36cc330b8747..13be802b6170 100644 --- a/drivers/cpufreq/unicore2-cpufreq.c +++ b/drivers/cpufreq/unicore2-cpufreq.c | |||
@@ -44,9 +44,9 @@ static int ucv2_target(struct cpufreq_policy *policy, | |||
44 | freqs.old = policy->cur; | 44 | freqs.old = policy->cur; |
45 | freqs.new = target_freq; | 45 | freqs.new = target_freq; |
46 | 46 | ||
47 | cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); | 47 | cpufreq_freq_transition_begin(policy, &freqs); |
48 | ret = clk_set_rate(policy->mclk, target_freq * 1000); | 48 | ret = clk_set_rate(policy->mclk, target_freq * 1000); |
49 | cpufreq_notify_post_transition(policy, &freqs, ret); | 49 | cpufreq_freq_transition_end(policy, &freqs, ret); |
50 | 50 | ||
51 | return ret; | 51 | return ret; |
52 | } | 52 | } |