aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-12 05:58:23 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-12 05:58:23 -0400
commit963c6527e0a0e285736ad482b8142d098f9c2288 (patch)
tree00016d016fbddc66cf4855d1a46657c8788d3840 /arch/i386
parentc1502e28346fd3b9955ce654c96212c4748d900d (diff)
parent4e54e9f4423a86aa21b70cb9d339cb09f275188f (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits) ACPI: thermal: add DMI hooks to handle AOpen's broken Award BIOS ACPI: thermal: create "thermal.act=" to disable or override active trip point ACPI: thermal: create "thermal.nocrt" to disable critical actions ACPI: thermal: create "thermal.psv=" to override passive trip points ACPI: thermal: expose "thermal.tzp=" to set global polling frequency ACPI: thermal: create "thermal.off=1" to disable ACPI thermal support ACPI: thinkpad-acpi: fix sysfs paths in documentation ACPI: static ACPI EC: remove potential deadlock from EC ACPI: dock: Send key=value pair instead of plain value ACPI: bay: send envp with uevent - fix acpi-cpufreq: Fix some x86/x86-64 acpi-cpufreq driver issues ACPI: fix "Time Problems with 2.6.23-rc1-gf695baf2" ACPI: thinkpad-acpi: change thinkpad-acpi input default and kconfig help ACPI: EC: fix run-together printk lines ACPI: sbs: remove dead code ACPI: EC: acpi_ec_remove(): fix use-after-free ACPI: EC: Switch from boot_ec as soon as we find its desc in DSDT. ACPI: EC: fix build warning ACPI: EC: If ECDT is not found, look up EC in DSDT. ...
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c41
1 files changed, 15 insertions, 26 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 32d04b083e38..705e13a30781 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -68,7 +68,8 @@ struct acpi_cpufreq_data {
68}; 68};
69 69
70static struct acpi_cpufreq_data *drv_data[NR_CPUS]; 70static struct acpi_cpufreq_data *drv_data[NR_CPUS];
71static struct acpi_processor_performance *acpi_perf_data[NR_CPUS]; 71/* acpi_perf_data is a pointer to percpu data. */
72static struct acpi_processor_performance *acpi_perf_data;
72 73
73static struct cpufreq_driver acpi_cpufreq_driver; 74static struct cpufreq_driver acpi_cpufreq_driver;
74 75
@@ -508,24 +509,14 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
508 * do _PDC and _PSD and find out the processor dependency for the 509 * do _PDC and _PSD and find out the processor dependency for the
509 * actual init that will happen later... 510 * actual init that will happen later...
510 */ 511 */
511static int acpi_cpufreq_early_init(void) 512static int __init acpi_cpufreq_early_init(void)
512{ 513{
513 struct acpi_processor_performance *data;
514 unsigned int i, j;
515
516 dprintk("acpi_cpufreq_early_init\n"); 514 dprintk("acpi_cpufreq_early_init\n");
517 515
518 for_each_possible_cpu(i) { 516 acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
519 data = kzalloc(sizeof(struct acpi_processor_performance), 517 if (!acpi_perf_data) {
520 GFP_KERNEL); 518 dprintk("Memory allocation error for acpi_perf_data.\n");
521 if (!data) { 519 return -ENOMEM;
522 for_each_possible_cpu(j) {
523 kfree(acpi_perf_data[j]);
524 acpi_perf_data[j] = NULL;
525 }
526 return -ENOMEM;
527 }
528 acpi_perf_data[i] = data;
529 } 520 }
530 521
531 /* Do initialization in ACPI core */ 522 /* Do initialization in ACPI core */
@@ -574,14 +565,11 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
574 565
575 dprintk("acpi_cpufreq_cpu_init\n"); 566 dprintk("acpi_cpufreq_cpu_init\n");
576 567
577 if (!acpi_perf_data[cpu])
578 return -ENODEV;
579
580 data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL); 568 data = kzalloc(sizeof(struct acpi_cpufreq_data), GFP_KERNEL);
581 if (!data) 569 if (!data)
582 return -ENOMEM; 570 return -ENOMEM;
583 571
584 data->acpi_data = acpi_perf_data[cpu]; 572 data->acpi_data = percpu_ptr(acpi_perf_data, cpu);
585 drv_data[cpu] = data; 573 drv_data[cpu] = data;
586 574
587 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) 575 if (cpu_has(c, X86_FEATURE_CONSTANT_TSC))
@@ -778,24 +766,25 @@ static struct cpufreq_driver acpi_cpufreq_driver = {
778 766
779static int __init acpi_cpufreq_init(void) 767static int __init acpi_cpufreq_init(void)
780{ 768{
769 int ret;
770
781 dprintk("acpi_cpufreq_init\n"); 771 dprintk("acpi_cpufreq_init\n");
782 772
783 acpi_cpufreq_early_init(); 773 ret = acpi_cpufreq_early_init();
774 if (ret)
775 return ret;
784 776
785 return cpufreq_register_driver(&acpi_cpufreq_driver); 777 return cpufreq_register_driver(&acpi_cpufreq_driver);
786} 778}
787 779
788static void __exit acpi_cpufreq_exit(void) 780static void __exit acpi_cpufreq_exit(void)
789{ 781{
790 unsigned int i;
791 dprintk("acpi_cpufreq_exit\n"); 782 dprintk("acpi_cpufreq_exit\n");
792 783
793 cpufreq_unregister_driver(&acpi_cpufreq_driver); 784 cpufreq_unregister_driver(&acpi_cpufreq_driver);
794 785
795 for_each_possible_cpu(i) { 786 free_percpu(acpi_perf_data);
796 kfree(acpi_perf_data[i]); 787
797 acpi_perf_data[i] = NULL;
798 }
799 return; 788 return;
800} 789}
801 790