vserver 1.9.3
[linux-2.6.git] / drivers / cpufreq / cpufreq_userspace.c
index 161e8a2..558cc9d 100644 (file)
@@ -82,6 +82,13 @@ userspace_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
 {
         struct cpufreq_freqs *freq = data;
 
+       /* Don't update cur_freq if CPU is managed and we're
+        * waking up: else we won't remember what frequency 
+        * we need to set the CPU to.
+        */
+       if (cpu_is_managed[freq->cpu] && (val == CPUFREQ_RESUMECHANGE))
+               return 0;
+
        cpu_cur_freq[freq->cpu] = freq->new;
 
         return 0;
@@ -147,6 +154,9 @@ EXPORT_SYMBOL_GPL(cpufreq_setmax);
 
 #ifdef CONFIG_CPU_FREQ_24_API
 
+#warning The /proc/sys/cpu/ and sysctl interface to cpufreq will be removed from the 2.6. kernel series soon after 2005-01-01
+
+static unsigned int warning_print = 0;
 
 /*********************** cpufreq_sysctl interface ********************/
 static int
@@ -162,6 +172,13 @@ cpufreq_procctl(ctl_table *ctl, int write, struct file *filp,
                return 0;
        }
 
+       if (!warning_print) {
+               warning_print++;
+               printk(KERN_INFO "Access to /proc/sys/cpu/ is deprecated and "
+                       "will be removed from (new) 2.6. kernels soon "
+                       "after 2005-01-01\n");
+       }
+
        if (write) {
                unsigned int freq;
 
@@ -197,6 +214,13 @@ cpufreq_sysctl(ctl_table *table, int __user *name, int nlen,
        if (!cpu_online(cpu))
                return -EINVAL;
 
+       if (!warning_print) {
+               warning_print++;
+               printk(KERN_INFO "Access to /proc/sys/cpu/ is deprecated and "
+                       "will be removed from (new) 2.6. kernels soon "
+                       "after 2005-01-01\n");
+       }
+
        if (oldval && oldlenp) {
                size_t oldlen;
 
@@ -522,6 +546,9 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
                else if (policy->min > cpu_cur_freq[cpu])
                        __cpufreq_driver_target(&current_policy[cpu], policy->min, 
                              CPUFREQ_RELATION_L);
+               else
+                       __cpufreq_driver_target(&current_policy[cpu], cpu_cur_freq[cpu],
+                             CPUFREQ_RELATION_L);
                memcpy (&current_policy[cpu], policy, sizeof(struct cpufreq_policy));
                up(&userspace_sem);
                break;