Revert "cpufreq: set core volt to 1.0V when reboot, and make sure core rate will...
author陈亮 <cl@rock-chips.com>
Sun, 4 May 2014 09:00:29 +0000 (02:00 -0700)
committer陈亮 <cl@rock-chips.com>
Sun, 4 May 2014 09:00:29 +0000 (02:00 -0700)
reboot limit core rate at cpufreq.c may happen while ddr freq limit core rate.
it cause dvfs_clk_enable_limit restore wrong min && max;

This reverts commit 4cc5af311c35403c6fe6bce846c890dc04902418.

arch/arm/mach-rockchip/ddr_freq.c
drivers/cpufreq/rockchip-cpufreq.c

index 41d2d04eeb9efa95d0d8a01b3009087ce8b2f10a..c371a042fcaaa227d4450f2990b27a37ccc4f335 100755 (executable)
@@ -78,9 +78,6 @@ static noinline void ddrfreq_clear_sys_status(int status)
 
 static void ddrfreq_mode(bool auto_self_refresh, unsigned long *target_rate, char *name)
 {
-       unsigned int min_rate, max_rate;
-       int freq_limit_en;
-
        ddr.mode = name;
        if (auto_self_refresh != ddr.auto_self_refresh) {
                ddr_set_auto_self_refresh(auto_self_refresh);
@@ -88,17 +85,12 @@ static void ddrfreq_mode(bool auto_self_refresh, unsigned long *target_rate, cha
                dprintk(DEBUG_DDR, "change auto self refresh to %d when %s\n", auto_self_refresh, name);
        }
        if (*target_rate != dvfs_clk_get_rate(ddr.clk_dvfs_node)) {
-               freq_limit_en = dvfs_clk_get_limit(clk_cpu_dvfs_node, &min_rate, &max_rate);
                dvfs_clk_enable_limit(clk_cpu_dvfs_node, 600000000, -1);
                if (dvfs_clk_set_rate(ddr.clk_dvfs_node, *target_rate) == 0) {
                        *target_rate = dvfs_clk_get_rate(ddr.clk_dvfs_node);
                        dprintk(DEBUG_DDR, "change freq to %lu MHz when %s\n", *target_rate / MHZ, name);
                }
-               if (freq_limit_en) {
-                       dvfs_clk_enable_limit(clk_cpu_dvfs_node, min_rate, max_rate);
-               } else {
-                       dvfs_clk_disable_limit(clk_cpu_dvfs_node);
-               }
+               dvfs_clk_enable_limit(clk_cpu_dvfs_node, 0, -1);
        }
 }
 
index c8496eabba666138ba4f35c313f4262b2511c93d..22a7baedd8a515fe0a10eb8a0381a2020827517c 100644 (file)
@@ -109,7 +109,6 @@ static unsigned int get_freq_from_table(unsigned int max_freq)
 
 static int cpufreq_notifier_policy(struct notifier_block *nb, unsigned long val, void *data)
 {
-       static unsigned int min_rate=0, max_rate=-1;
        struct cpufreq_policy *policy = data;
 
        if (val != CPUFREQ_ADJUST)
@@ -117,10 +116,9 @@ static int cpufreq_notifier_policy(struct notifier_block *nb, unsigned long val,
 
        if (cpufreq_is_ondemand(policy)) {
                FREQ_DBG("queue work\n");
-               dvfs_clk_enable_limit(clk_cpu_dvfs_node, min_rate, max_rate);
+               dvfs_clk_enable_limit(clk_cpu_dvfs_node, 0, ~0);
        } else {
                FREQ_DBG("cancel work\n");
-               dvfs_clk_get_limit(clk_cpu_dvfs_node, &min_rate, &max_rate);
                dvfs_clk_disable_limit(clk_cpu_dvfs_node);
        }
 
@@ -387,10 +385,14 @@ static struct notifier_block cpufreq_pm_notifier = {
 
 static int cpufreq_reboot_notifier_event(struct notifier_block *this, unsigned long event, void *ptr)
 {
+       struct cpufreq_policy *policy = cpufreq_cpu_get(0);
 
-       dvfs_clk_enable_limit(clk_cpu_dvfs_node, 1000*suspend_freq, 1000*suspend_freq);
-       printk("cpufreq: reboot set core rate=%lu, volt=%d\n", dvfs_clk_get_rate(clk_cpu_dvfs_node), 
-               regulator_get_voltage(clk_cpu_dvfs_node->vd->regulator));
+       if (policy) {
+               is_booting = false;
+               policy->cur++;
+               cpufreq_driver_target(policy, suspend_freq, DISABLE_FURTHER_CPUFREQ | CPUFREQ_RELATION_H);
+               cpufreq_cpu_put(policy);
+       }
 
        return NOTIFY_OK;
 }