aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/pcc-cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/pcc-cpufreq.c')
-rw-r--r--drivers/cpufreq/pcc-cpufreq.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
index e2b4f40ff69a..1c0f1067af73 100644
--- a/drivers/cpufreq/pcc-cpufreq.c
+++ b/drivers/cpufreq/pcc-cpufreq.c
@@ -213,6 +213,7 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
213 cpu, target_freq, 213 cpu, target_freq,
214 (pcch_virt_addr + pcc_cpu_data->input_offset)); 214 (pcch_virt_addr + pcc_cpu_data->input_offset));
215 215
216 freqs.old = policy->cur;
216 freqs.new = target_freq; 217 freqs.new = target_freq;
217 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); 218 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
218 219
@@ -228,25 +229,20 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
228 memset_io((pcch_virt_addr + pcc_cpu_data->input_offset), 0, BUF_SZ); 229 memset_io((pcch_virt_addr + pcc_cpu_data->input_offset), 0, BUF_SZ);
229 230
230 status = ioread16(&pcch_hdr->status); 231 status = ioread16(&pcch_hdr->status);
232 iowrite16(0, &pcch_hdr->status);
233
234 cpufreq_notify_post_transition(policy, &freqs, status != CMD_COMPLETE);
235 spin_unlock(&pcc_lock);
236
231 if (status != CMD_COMPLETE) { 237 if (status != CMD_COMPLETE) {
232 pr_debug("target: FAILED for cpu %d, with status: 0x%x\n", 238 pr_debug("target: FAILED for cpu %d, with status: 0x%x\n",
233 cpu, status); 239 cpu, status);
234 goto cmd_incomplete; 240 return -EINVAL;
235 } 241 }
236 iowrite16(0, &pcch_hdr->status);
237 242
238 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
239 pr_debug("target: was SUCCESSFUL for cpu %d\n", cpu); 243 pr_debug("target: was SUCCESSFUL for cpu %d\n", cpu);
240 spin_unlock(&pcc_lock);
241 244
242 return 0; 245 return 0;
243
244cmd_incomplete:
245 freqs.new = freqs.old;
246 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
247 iowrite16(0, &pcch_hdr->status);
248 spin_unlock(&pcc_lock);
249 return -EINVAL;
250} 246}
251 247
252static int pcc_get_offset(int cpu) 248static int pcc_get_offset(int cpu)