Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=22c970f3468a6766b362d57fa32ebb92cb8cd6db
Commit:     22c970f3468a6766b362d57fa32ebb92cb8cd6db
Parent:     e8e49190f64896afe79f7136a67c2bdefbd3e322
Author:     Thomas Renninger <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 19 15:48:34 2007 +0200
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 14:32:02 2007 -0400

    [CPUFREQ] Fix limited cpufreq when booted on battery
    
    References:
    https://bugzilla.novell.com/show_bug.cgi?id=231107
    https://bugzilla.novell.com/show_bug.cgi?id=264077
    
    Fix limited cpufreq when booted on battery
    
    If booted on battery:
    cpufreq_set_policy (evil) is invoked which calls verify_within_limits.
    max_freq gets lowered and therefore users_policy.max, which
    is used to restore higher freqs via update_policy later is set to the
    already limited frequency -> you can never go up again, even BIOS
    allows higher freqs later.
    
    Signed-off-by: Thomas Renninger <[EMAIL PROTECTED]>
    Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 drivers/cpufreq/cpufreq.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 3162010..fcb86dd 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -768,6 +768,9 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
                unlock_policy_rwsem_write(cpu);
                goto err_out;
        }
+       policy->user_policy.min = policy->cpuinfo.min_freq;
+       policy->user_policy.max = policy->cpuinfo.max_freq;
+       policy->user_policy.governor = policy->governor;
 
 #ifdef CONFIG_SMP
        for_each_cpu_mask(j, policy->cpus) {
@@ -858,10 +861,13 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
 
        policy->governor = NULL; /* to assure that the starting sequence is
                                  * run in cpufreq_set_policy */
-       unlock_policy_rwsem_write(cpu);
 
        /* set default policy */
-       ret = cpufreq_set_policy(&new_policy);
+       ret = __cpufreq_set_policy(policy, &new_policy);
+       policy->user_policy.policy = policy->policy;
+
+       unlock_policy_rwsem_write(cpu);
+
        if (ret) {
                dprintk("setting policy failed\n");
                goto err_out_unregister;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to