Skip to contentSkip to conversation

PPC frequency change issues

PATCH In review Thomas Renninger 2 participants 2 messages Jan 19, 2006 – Jan 20, 2006 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 PPC frequency change issues

Author: Thomas Renninger <[email protected]>

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

cpufreq.c | 10 ++++++++++

1 files changed, 10 insertions(+)
drivers/cpufreq/cpufreq.c +0 -0
Index: linux-2.6.15/drivers/cpufreq/cpufreq.c
===================================================================
@@ -1402,6 +1402,16 @@
	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);

	up(&data->lock);
#1 lore raw

and the other one...

Thomas

Author: Thomas Renninger <[email protected]>

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

cpufreq.c | 10 ++++++++++

1 files changed, 10 insertions(+)
drivers/cpufreq/cpufreq.c +10 -0
Index: linux-2.6.15/drivers/cpufreq/cpufreq.c
===================================================================
@@ -1402,6 +1402,16 @@
 	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);
 
 	up(&data->lock);

_______________________________________________
Cpufreq mailing list
[email protected]
http://lists.linux.org.uk/mailman/listinfo/cpufreq