[CPUFREQ] _PPC frequency change issues
authorThomas Renninger <trenn@suse.de>
Thu, 26 Jan 2006 17:46:33 +0000 (18:46 +0100)
committerDave Jones <davej@redhat.com>
Thu, 26 Jan 2006 18:49:39 +0000 (10:49 -0800)
BIOS might change frequency behind our back when BIOS changes allowed
frequencies via _PPC.  In this case cpufreq core got out of sync.
Ask driver for current freq and notify governors about a change

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/cpufreq/cpufreq.c

index 0a6c4c8642e72599cb0ffb609c1804a30040520f..7a511479ae29b615e0d8fe1fcfdd223212a7e2a8 100644 (file)
@@ -1429,6 +1429,14 @@ int cpufreq_update_policy(unsigned int cpu)
        policy.policy = data->user_policy.policy;
        policy.governor = data->user_policy.governor;
 
+       /* BIOS might change freq behind our back
+         -> ask driver for current freq and notify governors about a change */
+       if (cpufreq_driver->get) {
+               policy.cur = cpufreq_driver->get(cpu);
+               if (data->cur != policy.cur)
+                       cpufreq_out_of_sync(cpu, data->cur, policy.cur);
+       }
+
        ret = __cpufreq_set_policy(data, &policy);
 
        mutex_unlock(&data->lock);