aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-10-14 02:26:42 -0400
committerLen Brown <len.brown@intel.com>2006-10-14 02:26:42 -0400
commit384bc8f07075804b9ce8807ed54dd7a483bd749a (patch)
tree99728f6d04d0000ff297b537e54996dde5814545 /drivers
parente0749be933c3b0c4498d693524b0aa15cbdf0f8b (diff)
parent37605a6900f6b4d886d995751fcfeef88c4e462c (diff)
Pull bugzilla-5534 into test branch
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/events/evmisc.c14
-rw-r--r--drivers/acpi/osl.c34
2 files changed, 14 insertions, 34 deletions
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 6eef4efddcf6..ee2a10bf9077 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -342,20 +342,8 @@ static u32 acpi_ev_global_lock_handler(void *context)
342 if (acquired) { 342 if (acquired) {
343 343
344 /* Got the lock, now wake all threads waiting for it */ 344 /* Got the lock, now wake all threads waiting for it */
345
346 acpi_gbl_global_lock_acquired = TRUE; 345 acpi_gbl_global_lock_acquired = TRUE;
347 346 acpi_ev_global_lock_thread(context);
348 /* Run the Global Lock thread which will signal all waiting threads */
349
350 status =
351 acpi_os_execute(OSL_GLOBAL_LOCK_HANDLER,
352 acpi_ev_global_lock_thread, context);
353 if (ACPI_FAILURE(status)) {
354 ACPI_EXCEPTION((AE_INFO, status,
355 "Could not queue Global Lock thread"));
356
357 return (ACPI_INTERRUPT_NOT_HANDLED);
358 }
359 } 347 }
360 348
361 return (ACPI_INTERRUPT_HANDLED); 349 return (ACPI_INTERRUPT_HANDLED);
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;
73static acpi_osd_handler acpi_irq_handler; 73static acpi_osd_handler acpi_irq_handler;
74static void *acpi_irq_context; 74static void *acpi_irq_context;
75static struct workqueue_struct *kacpid_wq; 75static struct workqueue_struct *kacpid_wq;
76static struct workqueue_struct *kacpi_notify_wq;
76 77
77acpi_status acpi_os_initialize(void) 78acpi_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
567static void acpi_os_execute_deferred(void *context) 570static 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
649EXPORT_SYMBOL(acpi_os_execute); 641EXPORT_SYMBOL(acpi_os_execute);