diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-15 14:02:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-15 14:02:52 -0400 |
commit | 0b269d8462a9f0058afb46eaee56e0732acf16c4 (patch) | |
tree | f6f5d801b0f991b34b7a71394370fc31746883bb /drivers/acpi/osl.c | |
parent | ed75ded7dd3fdb647df4efefc5d11158e3d182be (diff) | |
parent | 9aaed2b42d00d4abb2748d72d599a8033600e2bf (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: check battery status on resume for un/plug events during sleep
ACPICA: Fix incorrect handling of PCI Express Root Bridge _HID
ACPI: asus_acpi: don't printk on writing garbage to proc files
ACPI: asus_acpi: fix proc files parsing
ACPI: SCI interrupt source override
ACPI: fix printk format warnings
ACPI: fix section for CPU init functions
ACPI: update comments in motherboard.c
ACPI: acpi_pci_link_set() can allocate with either GFP_ATOMIC or GFP_KERNEL
ACPI: fix potential OOPS in power driver with CONFIG_ACPI_DEBUG
ACPI: ibm_acpi: delete obsolete documentation
ACPI: created a dedicated workqueue for notify() execution
ACPI: Remove deferred execution from global lock acquire wakeup path
MSI S270 Laptop support: backlight, wlan, bluetooth states
ACPI: EC: export ec_transaction() for msi-laptop driver
ACPI: EC: Simplify acpi_hw_low_level*() with inb()/outb().
ACPI: EC: Unify poll and interrupt gpe handlers
ACPI: EC: Unify poll and interrupt mode transaction functions
ACPI: EC: Remove unused variables and duplicated code
ACPI: EC: Remove unnecessary delay added by previous transation patch.
...
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 068fe4f100b0..c84286cbbe25 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
@@ -73,6 +73,7 @@ static unsigned int acpi_irq_irq; | |||
73 | static acpi_osd_handler acpi_irq_handler; | 73 | static acpi_osd_handler acpi_irq_handler; |
74 | static void *acpi_irq_context; | 74 | static void *acpi_irq_context; |
75 | static struct workqueue_struct *kacpid_wq; | 75 | static struct workqueue_struct *kacpid_wq; |
76 | static struct workqueue_struct *kacpi_notify_wq; | ||
76 | 77 | ||
77 | acpi_status acpi_os_initialize(void) | 78 | acpi_status acpi_os_initialize(void) |
78 | { | 79 | { |
@@ -91,8 +92,9 @@ acpi_status acpi_os_initialize1(void) | |||
91 | return AE_NULL_ENTRY; | 92 | return AE_NULL_ENTRY; |
92 | } | 93 | } |
93 | kacpid_wq = create_singlethread_workqueue("kacpid"); | 94 | kacpid_wq = create_singlethread_workqueue("kacpid"); |
95 | kacpi_notify_wq = create_singlethread_workqueue("kacpi_notify"); | ||
94 | BUG_ON(!kacpid_wq); | 96 | BUG_ON(!kacpid_wq); |
95 | 97 | BUG_ON(!kacpi_notify_wq); | |
96 | return AE_OK; | 98 | return AE_OK; |
97 | } | 99 | } |
98 | 100 | ||
@@ -104,6 +106,7 @@ acpi_status acpi_os_terminate(void) | |||
104 | } | 106 | } |
105 | 107 | ||
106 | destroy_workqueue(kacpid_wq); | 108 | destroy_workqueue(kacpid_wq); |
109 | destroy_workqueue(kacpi_notify_wq); | ||
107 | 110 | ||
108 | return AE_OK; | 111 | return AE_OK; |
109 | } | 112 | } |
@@ -566,10 +569,7 @@ void acpi_os_derive_pci_id(acpi_handle rhandle, /* upper bound */ | |||
566 | 569 | ||
567 | static void acpi_os_execute_deferred(void *context) | 570 | static void acpi_os_execute_deferred(void *context) |
568 | { | 571 | { |
569 | struct acpi_os_dpc *dpc = NULL; | 572 | struct acpi_os_dpc *dpc = (struct acpi_os_dpc *)context; |
570 | |||
571 | |||
572 | dpc = (struct acpi_os_dpc *)context; | ||
573 | if (!dpc) { | 573 | if (!dpc) { |
574 | printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); | 574 | printk(KERN_ERR PREFIX "Invalid (NULL) context\n"); |
575 | return; | 575 | return; |
@@ -604,14 +604,12 @@ acpi_status acpi_os_execute(acpi_execute_type type, | |||
604 | struct acpi_os_dpc *dpc; | 604 | struct acpi_os_dpc *dpc; |
605 | struct work_struct *task; | 605 | struct work_struct *task; |
606 | 606 | ||
607 | ACPI_FUNCTION_TRACE("os_queue_for_execution"); | ||
608 | |||
609 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, | 607 | ACPI_DEBUG_PRINT((ACPI_DB_EXEC, |
610 | "Scheduling function [%p(%p)] for deferred execution.\n", | 608 | "Scheduling function [%p(%p)] for deferred execution.\n", |
611 | function, context)); | 609 | function, context)); |
612 | 610 | ||
613 | if (!function) | 611 | if (!function) |
614 | return_ACPI_STATUS(AE_BAD_PARAMETER); | 612 | return AE_BAD_PARAMETER; |
615 | 613 | ||
616 | /* | 614 | /* |
617 | * Allocate/initialize DPC structure. Note that this memory will be | 615 | * Allocate/initialize DPC structure. Note that this memory will be |
@@ -624,26 +622,20 @@ acpi_status acpi_os_execute(acpi_execute_type type, | |||
624 | * from the same memory. | 622 | * from the same memory. |
625 | */ | 623 | */ |
626 | 624 | ||
627 | dpc = | 625 | dpc = kmalloc(sizeof(struct acpi_os_dpc) + |
628 | kmalloc(sizeof(struct acpi_os_dpc) + sizeof(struct work_struct), | 626 | sizeof(struct work_struct), GFP_ATOMIC); |
629 | GFP_ATOMIC); | ||
630 | if (!dpc) | 627 | if (!dpc) |
631 | return_ACPI_STATUS(AE_NO_MEMORY); | 628 | return AE_NO_MEMORY; |
632 | |||
633 | dpc->function = function; | 629 | dpc->function = function; |
634 | dpc->context = context; | 630 | dpc->context = context; |
635 | |||
636 | task = (void *)(dpc + 1); | 631 | task = (void *)(dpc + 1); |
637 | INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); | 632 | INIT_WORK(task, acpi_os_execute_deferred, (void *)dpc); |
638 | 633 | if (!queue_work((type == OSL_NOTIFY_HANDLER)? | |
639 | if (!queue_work(kacpid_wq, task)) { | 634 | kacpi_notify_wq : kacpid_wq, task)) { |
640 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | ||
641 | "Call to queue_work() failed.\n")); | ||
642 | kfree(dpc); | ||
643 | status = AE_ERROR; | 635 | status = AE_ERROR; |
636 | kfree(dpc); | ||
644 | } | 637 | } |
645 | 638 | return status; | |
646 | return_ACPI_STATUS(status); | ||
647 | } | 639 | } |
648 | 640 | ||
649 | EXPORT_SYMBOL(acpi_os_execute); | 641 | EXPORT_SYMBOL(acpi_os_execute); |