aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-13 19:06:30 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-13 19:06:30 -0400
commitaf09f1e4b3214569de93bc9309c35014e5c8a3d0 (patch)
treecb5dc861a5114fca5cd9e52e0d25f835bdd79c42 /drivers
parente030dbf91a87da7e8be3be3ca781558695bea683 (diff)
parent9a60ddbcb710ff78cd8c772681723a04e3f5aba3 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] Fix typos in powernow-k8 printk's. [CPUFREQ] Restore previously used governor on a hot-replugged CPU [CPUFREQ] bugfix cpufreq in combination with performance governor [CPUFREQ] powernow-k8 compile fix. [CPUFREQ] the overdue removal of X86_SPEEDSTEP_CENTRINO_ACPI [CPUFREQ] Longhaul - Option to disable ACPI C3 support Fixed up arch/i386/kernel/cpu/cpufreq/powernow-k8.c due to revert that got fixed differently in the cpufreq branch. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0db9e1bda322..2f6a73c01b71 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -39,6 +39,10 @@
39 */ 39 */
40static struct cpufreq_driver *cpufreq_driver; 40static struct cpufreq_driver *cpufreq_driver;
41static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS]; 41static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];
42#ifdef CONFIG_HOTPLUG_CPU
43/* This one keeps track of the previously set governor of a removed CPU */
44static struct cpufreq_governor *cpufreq_cpu_governor[NR_CPUS];
45#endif
42static DEFINE_SPINLOCK(cpufreq_driver_lock); 46static DEFINE_SPINLOCK(cpufreq_driver_lock);
43 47
44/* 48/*
@@ -770,9 +774,17 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
770 } 774 }
771 policy->user_policy.min = policy->cpuinfo.min_freq; 775 policy->user_policy.min = policy->cpuinfo.min_freq;
772 policy->user_policy.max = policy->cpuinfo.max_freq; 776 policy->user_policy.max = policy->cpuinfo.max_freq;
773 policy->user_policy.governor = policy->governor;
774 777
775#ifdef CONFIG_SMP 778#ifdef CONFIG_SMP
779
780#ifdef CONFIG_HOTPLUG_CPU
781 if (cpufreq_cpu_governor[cpu]){
782 policy->governor = cpufreq_cpu_governor[cpu];
783 dprintk("Restoring governor %s for cpu %d\n",
784 policy->governor->name, cpu);
785 }
786#endif
787
776 for_each_cpu_mask(j, policy->cpus) { 788 for_each_cpu_mask(j, policy->cpus) {
777 if (cpu == j) 789 if (cpu == j)
778 continue; 790 continue;
@@ -873,6 +885,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
873 /* set default policy */ 885 /* set default policy */
874 ret = __cpufreq_set_policy(policy, &new_policy); 886 ret = __cpufreq_set_policy(policy, &new_policy);
875 policy->user_policy.policy = policy->policy; 887 policy->user_policy.policy = policy->policy;
888 policy->user_policy.governor = policy->governor;
876 889
877 unlock_policy_rwsem_write(cpu); 890 unlock_policy_rwsem_write(cpu);
878 891
@@ -969,6 +982,11 @@ static int __cpufreq_remove_dev (struct sys_device * sys_dev)
969 } 982 }
970 983
971#ifdef CONFIG_SMP 984#ifdef CONFIG_SMP
985
986#ifdef CONFIG_HOTPLUG_CPU
987 cpufreq_cpu_governor[cpu] = data->governor;
988#endif
989
972 /* if we have other CPUs still registered, we need to unlink them, 990 /* if we have other CPUs still registered, we need to unlink them,
973 * or else wait_for_completion below will lock up. Clean the 991 * or else wait_for_completion below will lock up. Clean the
974 * cpufreq_cpu_data[] while holding the lock, and remove the sysfs 992 * cpufreq_cpu_data[] while holding the lock, and remove the sysfs
@@ -989,6 +1007,9 @@ static int __cpufreq_remove_dev (struct sys_device * sys_dev)
989 if (j == cpu) 1007 if (j == cpu)
990 continue; 1008 continue;
991 dprintk("removing link for cpu %u\n", j); 1009 dprintk("removing link for cpu %u\n", j);
1010#ifdef CONFIG_HOTPLUG_CPU
1011 cpufreq_cpu_governor[j] = data->governor;
1012#endif
992 cpu_sys_dev = get_cpu_sysdev(j); 1013 cpu_sys_dev = get_cpu_sysdev(j);
993 sysfs_remove_link(&cpu_sys_dev->kobj, "cpufreq"); 1014 sysfs_remove_link(&cpu_sys_dev->kobj, "cpufreq");
994 cpufreq_cpu_put(data); 1015 cpufreq_cpu_put(data);
@@ -1687,7 +1708,6 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
1687{ 1708{
1688 unsigned int cpu = (unsigned long)hcpu; 1709 unsigned int cpu = (unsigned long)hcpu;
1689 struct sys_device *sys_dev; 1710 struct sys_device *sys_dev;
1690 struct cpufreq_policy *policy;
1691 1711
1692 sys_dev = get_cpu_sysdev(cpu); 1712 sys_dev = get_cpu_sysdev(cpu);
1693 if (sys_dev) { 1713 if (sys_dev) {
@@ -1701,11 +1721,6 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
1701 if (unlikely(lock_policy_rwsem_write(cpu))) 1721 if (unlikely(lock_policy_rwsem_write(cpu)))
1702 BUG(); 1722 BUG();
1703 1723
1704 policy = cpufreq_cpu_data[cpu];
1705 if (policy) {
1706 __cpufreq_driver_target(policy, policy->min,
1707 CPUFREQ_RELATION_H);
1708 }
1709 __cpufreq_remove_dev(sys_dev); 1724 __cpufreq_remove_dev(sys_dev);
1710 break; 1725 break;
1711 case CPU_DOWN_FAILED: 1726 case CPU_DOWN_FAILED: