diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-03 15:04:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-03 15:04:39 -0500 |
commit | 7d3b56ba37a95f1f370f50258ed3954c304c524b (patch) | |
tree | 86102527b92f02450aa245f084ffb491c18d2e0a /drivers/acpi/processor_perflib.c | |
parent | 269b012321f2f1f8e4648c43a93bf432b42c6668 (diff) | |
parent | ab14398abd195af91a744c320a52a1bce814dd1e (diff) |
Merge branch 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'cpus4096-for-linus-3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (77 commits)
x86: setup_per_cpu_areas() cleanup
cpumask: fix compile error when CONFIG_NR_CPUS is not defined
cpumask: use alloc_cpumask_var_node where appropriate
cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
x86: use cpumask_var_t in acpi/boot.c
x86: cleanup some remaining usages of NR_CPUS where s/b nr_cpu_ids
sched: put back some stack hog changes that were undone in kernel/sched.c
x86: enable cpus display of kernel_max and offlined cpus
ia64: cpumask fix for is_affinity_mask_valid()
cpumask: convert RCU implementations, fix
xtensa: define __fls
mn10300: define __fls
m32r: define __fls
h8300: define __fls
frv: define __fls
cris: define __fls
cpumask: CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS
cpumask: zero extra bits in alloc_cpumask_var_node
cpumask: replace for_each_cpu_mask_nr with for_each_cpu in kernel/time/
cpumask: convert mm/
...
Diffstat (limited to 'drivers/acpi/processor_perflib.c')
-rw-r--r-- | drivers/acpi/processor_perflib.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 0d7b772bef50..846e227592d4 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -588,12 +588,15 @@ int acpi_processor_preregister_performance( | |||
588 | int count, count_target; | 588 | int count, count_target; |
589 | int retval = 0; | 589 | int retval = 0; |
590 | unsigned int i, j; | 590 | unsigned int i, j; |
591 | cpumask_t covered_cpus; | 591 | cpumask_var_t covered_cpus; |
592 | struct acpi_processor *pr; | 592 | struct acpi_processor *pr; |
593 | struct acpi_psd_package *pdomain; | 593 | struct acpi_psd_package *pdomain; |
594 | struct acpi_processor *match_pr; | 594 | struct acpi_processor *match_pr; |
595 | struct acpi_psd_package *match_pdomain; | 595 | struct acpi_psd_package *match_pdomain; |
596 | 596 | ||
597 | if (!alloc_cpumask_var(&covered_cpus, GFP_KERNEL)) | ||
598 | return -ENOMEM; | ||
599 | |||
597 | mutex_lock(&performance_mutex); | 600 | mutex_lock(&performance_mutex); |
598 | 601 | ||
599 | retval = 0; | 602 | retval = 0; |
@@ -617,7 +620,7 @@ int acpi_processor_preregister_performance( | |||
617 | } | 620 | } |
618 | 621 | ||
619 | pr->performance = percpu_ptr(performance, i); | 622 | pr->performance = percpu_ptr(performance, i); |
620 | cpu_set(i, pr->performance->shared_cpu_map); | 623 | cpumask_set_cpu(i, pr->performance->shared_cpu_map); |
621 | if (acpi_processor_get_psd(pr)) { | 624 | if (acpi_processor_get_psd(pr)) { |
622 | retval = -EINVAL; | 625 | retval = -EINVAL; |
623 | continue; | 626 | continue; |
@@ -650,18 +653,18 @@ int acpi_processor_preregister_performance( | |||
650 | } | 653 | } |
651 | } | 654 | } |
652 | 655 | ||
653 | cpus_clear(covered_cpus); | 656 | cpumask_clear(covered_cpus); |
654 | for_each_possible_cpu(i) { | 657 | for_each_possible_cpu(i) { |
655 | pr = per_cpu(processors, i); | 658 | pr = per_cpu(processors, i); |
656 | if (!pr) | 659 | if (!pr) |
657 | continue; | 660 | continue; |
658 | 661 | ||
659 | if (cpu_isset(i, covered_cpus)) | 662 | if (cpumask_test_cpu(i, covered_cpus)) |
660 | continue; | 663 | continue; |
661 | 664 | ||
662 | pdomain = &(pr->performance->domain_info); | 665 | pdomain = &(pr->performance->domain_info); |
663 | cpu_set(i, pr->performance->shared_cpu_map); | 666 | cpumask_set_cpu(i, pr->performance->shared_cpu_map); |
664 | cpu_set(i, covered_cpus); | 667 | cpumask_set_cpu(i, covered_cpus); |
665 | if (pdomain->num_processors <= 1) | 668 | if (pdomain->num_processors <= 1) |
666 | continue; | 669 | continue; |
667 | 670 | ||
@@ -699,8 +702,8 @@ int acpi_processor_preregister_performance( | |||
699 | goto err_ret; | 702 | goto err_ret; |
700 | } | 703 | } |
701 | 704 | ||
702 | cpu_set(j, covered_cpus); | 705 | cpumask_set_cpu(j, covered_cpus); |
703 | cpu_set(j, pr->performance->shared_cpu_map); | 706 | cpumask_set_cpu(j, pr->performance->shared_cpu_map); |
704 | count++; | 707 | count++; |
705 | } | 708 | } |
706 | 709 | ||
@@ -718,8 +721,8 @@ int acpi_processor_preregister_performance( | |||
718 | 721 | ||
719 | match_pr->performance->shared_type = | 722 | match_pr->performance->shared_type = |
720 | pr->performance->shared_type; | 723 | pr->performance->shared_type; |
721 | match_pr->performance->shared_cpu_map = | 724 | cpumask_copy(match_pr->performance->shared_cpu_map, |
722 | pr->performance->shared_cpu_map; | 725 | pr->performance->shared_cpu_map); |
723 | } | 726 | } |
724 | } | 727 | } |
725 | 728 | ||
@@ -731,14 +734,15 @@ err_ret: | |||
731 | 734 | ||
732 | /* Assume no coordination on any error parsing domain info */ | 735 | /* Assume no coordination on any error parsing domain info */ |
733 | if (retval) { | 736 | if (retval) { |
734 | cpus_clear(pr->performance->shared_cpu_map); | 737 | cpumask_clear(pr->performance->shared_cpu_map); |
735 | cpu_set(i, pr->performance->shared_cpu_map); | 738 | cpumask_set_cpu(i, pr->performance->shared_cpu_map); |
736 | pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; | 739 | pr->performance->shared_type = CPUFREQ_SHARED_TYPE_ALL; |
737 | } | 740 | } |
738 | pr->performance = NULL; /* Will be set for real in register */ | 741 | pr->performance = NULL; /* Will be set for real in register */ |
739 | } | 742 | } |
740 | 743 | ||
741 | mutex_unlock(&performance_mutex); | 744 | mutex_unlock(&performance_mutex); |
745 | free_cpumask_var(covered_cpus); | ||
742 | return retval; | 746 | return retval; |
743 | } | 747 | } |
744 | EXPORT_SYMBOL(acpi_processor_preregister_performance); | 748 | EXPORT_SYMBOL(acpi_processor_preregister_performance); |