diff options
author | Len Brown <len.brown@intel.com> | 2006-06-15 21:31:47 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-15 21:31:47 -0400 |
commit | c080a3e69dfb58ae9b8c7e70a1e33f4f4e493ea7 (patch) | |
tree | 849d913226a6d38b66bf5ad1ccf6ea07559009af /drivers/acpi/processor_perflib.c | |
parent | bf891bd65de65284f3964216fcde493dba5149db (diff) | |
parent | 36e430951af0b0d1bdfd50ce22e70079d02646df (diff) |
Pull sem2mutex into release branch
Diffstat (limited to 'drivers/acpi/processor_perflib.c')
-rw-r--r-- | drivers/acpi/processor_perflib.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index f36db22ce1ae..44a7b168e0ec 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF | 34 | #ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF |
35 | #include <linux/proc_fs.h> | 35 | #include <linux/proc_fs.h> |
36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
37 | #include <linux/mutex.h> | ||
37 | 38 | ||
38 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
39 | #endif | 40 | #endif |
@@ -48,7 +49,7 @@ | |||
48 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 49 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
49 | ACPI_MODULE_NAME("acpi_processor") | 50 | ACPI_MODULE_NAME("acpi_processor") |
50 | 51 | ||
51 | static DECLARE_MUTEX(performance_sem); | 52 | static DEFINE_MUTEX(performance_mutex); |
52 | 53 | ||
53 | /* | 54 | /* |
54 | * _PPC support is implemented as a CPUfreq policy notifier: | 55 | * _PPC support is implemented as a CPUfreq policy notifier: |
@@ -72,7 +73,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, | |||
72 | struct acpi_processor *pr; | 73 | struct acpi_processor *pr; |
73 | unsigned int ppc = 0; | 74 | unsigned int ppc = 0; |
74 | 75 | ||
75 | down(&performance_sem); | 76 | mutex_lock(&performance_mutex); |
76 | 77 | ||
77 | if (event != CPUFREQ_INCOMPATIBLE) | 78 | if (event != CPUFREQ_INCOMPATIBLE) |
78 | goto out; | 79 | goto out; |
@@ -93,7 +94,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, | |||
93 | core_frequency * 1000); | 94 | core_frequency * 1000); |
94 | 95 | ||
95 | out: | 96 | out: |
96 | up(&performance_sem); | 97 | mutex_unlock(&performance_mutex); |
97 | 98 | ||
98 | return 0; | 99 | return 0; |
99 | } | 100 | } |
@@ -564,16 +565,16 @@ acpi_processor_register_performance(struct acpi_processor_performance | |||
564 | if (!(acpi_processor_ppc_status & PPC_REGISTERED)) | 565 | if (!(acpi_processor_ppc_status & PPC_REGISTERED)) |
565 | return_VALUE(-EINVAL); | 566 | return_VALUE(-EINVAL); |
566 | 567 | ||
567 | down(&performance_sem); | 568 | mutex_lock(&performance_mutex); |
568 | 569 | ||
569 | pr = processors[cpu]; | 570 | pr = processors[cpu]; |
570 | if (!pr) { | 571 | if (!pr) { |
571 | up(&performance_sem); | 572 | mutex_unlock(&performance_mutex); |
572 | return_VALUE(-ENODEV); | 573 | return_VALUE(-ENODEV); |
573 | } | 574 | } |
574 | 575 | ||
575 | if (pr->performance) { | 576 | if (pr->performance) { |
576 | up(&performance_sem); | 577 | mutex_unlock(&performance_mutex); |
577 | return_VALUE(-EBUSY); | 578 | return_VALUE(-EBUSY); |
578 | } | 579 | } |
579 | 580 | ||
@@ -583,13 +584,13 @@ acpi_processor_register_performance(struct acpi_processor_performance | |||
583 | 584 | ||
584 | if (acpi_processor_get_performance_info(pr)) { | 585 | if (acpi_processor_get_performance_info(pr)) { |
585 | pr->performance = NULL; | 586 | pr->performance = NULL; |
586 | up(&performance_sem); | 587 | mutex_unlock(&performance_mutex); |
587 | return_VALUE(-EIO); | 588 | return_VALUE(-EIO); |
588 | } | 589 | } |
589 | 590 | ||
590 | acpi_cpufreq_add_file(pr); | 591 | acpi_cpufreq_add_file(pr); |
591 | 592 | ||
592 | up(&performance_sem); | 593 | mutex_unlock(&performance_mutex); |
593 | return_VALUE(0); | 594 | return_VALUE(0); |
594 | } | 595 | } |
595 | 596 | ||
@@ -603,11 +604,11 @@ acpi_processor_unregister_performance(struct acpi_processor_performance | |||
603 | 604 | ||
604 | ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance"); | 605 | ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance"); |
605 | 606 | ||
606 | down(&performance_sem); | 607 | mutex_lock(&performance_mutex); |
607 | 608 | ||
608 | pr = processors[cpu]; | 609 | pr = processors[cpu]; |
609 | if (!pr) { | 610 | if (!pr) { |
610 | up(&performance_sem); | 611 | mutex_unlock(&performance_mutex); |
611 | return_VOID; | 612 | return_VOID; |
612 | } | 613 | } |
613 | 614 | ||
@@ -617,7 +618,7 @@ acpi_processor_unregister_performance(struct acpi_processor_performance | |||
617 | 618 | ||
618 | acpi_cpufreq_remove_file(pr); | 619 | acpi_cpufreq_remove_file(pr); |
619 | 620 | ||
620 | up(&performance_sem); | 621 | mutex_unlock(&performance_mutex); |
621 | 622 | ||
622 | return_VOID; | 623 | return_VOID; |
623 | } | 624 | } |