aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2008-02-07 03:11:47 -0500
committerLen Brown <len.brown@intel.com>2008-02-07 03:11:47 -0500
commit7924e4f6519dd5b349ed146fe9fe35206730be67 (patch)
tree4f4c5b814abc02f55ec50cceb90331061948c887 /drivers
parent5531d28504461c4e96c6fbd80655a2bfd6481583 (diff)
parent17bc54eef91df29f0a22e8a1562a404cf7a68e74 (diff)
Merge branches 'release' and 'gpe-ack' into release
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/events/evgpe.c17
-rw-r--r--drivers/acpi/osl.c42
2 files changed, 21 insertions, 38 deletions
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index 056b78844829..31cb8cd8cabe 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -501,6 +501,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
501 * an interrupt handler. 501 * an interrupt handler.
502 * 502 *
503 ******************************************************************************/ 503 ******************************************************************************/
504static void acpi_ev_asynch_enable_gpe(void *context);
504 505
505static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) 506static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
506{ 507{
@@ -576,22 +577,30 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
576 method_node))); 577 method_node)));
577 } 578 }
578 } 579 }
580 /* Defer enabling of GPE until all notify handlers are done */
581 acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_ev_asynch_enable_gpe,
582 gpe_event_info);
583 return_VOID;
584}
579 585
580 if ((local_gpe_event_info.flags & ACPI_GPE_XRUPT_TYPE_MASK) == 586static void acpi_ev_asynch_enable_gpe(void *context)
587{
588 struct acpi_gpe_event_info *gpe_event_info = context;
589 acpi_status status;
590 if ((gpe_event_info->flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
581 ACPI_GPE_LEVEL_TRIGGERED) { 591 ACPI_GPE_LEVEL_TRIGGERED) {
582 /* 592 /*
583 * GPE is level-triggered, we clear the GPE status bit after 593 * GPE is level-triggered, we clear the GPE status bit after
584 * handling the event. 594 * handling the event.
585 */ 595 */
586 status = acpi_hw_clear_gpe(&local_gpe_event_info); 596 status = acpi_hw_clear_gpe(gpe_event_info);
587 if (ACPI_FAILURE(status)) { 597 if (ACPI_FAILURE(status)) {
588 return_VOID; 598 return_VOID;
589 } 599 }
590 } 600 }
591 601
592 /* Enable this GPE */ 602 /* Enable this GPE */
593 603 (void)acpi_hw_write_gpe_enable_reg(gpe_event_info);
594 (void)acpi_hw_write_gpe_enable_reg(&local_gpe_event_info);
595 return_VOID; 604 return_VOID;
596} 605}
597 606
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 9772a48f36f1..07c18dbde698 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -665,25 +665,6 @@ static void acpi_os_execute_deferred(struct work_struct *work)
665 dpc->function(dpc->context); 665 dpc->function(dpc->context);
666 kfree(dpc); 666 kfree(dpc);
667 667
668 /* Yield cpu to notify thread */
669 cond_resched();
670
671 return;
672}
673
674static void acpi_os_execute_notify(struct work_struct *work)
675{
676 struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
677
678 if (!dpc) {
679 printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
680 return;
681 }
682
683 dpc->function(dpc->context);
684
685 kfree(dpc);
686
687 return; 668 return;
688} 669}
689 670
@@ -707,7 +688,7 @@ acpi_status acpi_os_execute(acpi_execute_type type,
707{ 688{
708 acpi_status status = AE_OK; 689 acpi_status status = AE_OK;
709 struct acpi_os_dpc *dpc; 690 struct acpi_os_dpc *dpc;
710 691 struct workqueue_struct *queue;
711 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 692 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
712 "Scheduling function [%p(%p)] for deferred execution.\n", 693 "Scheduling function [%p(%p)] for deferred execution.\n",
713 function, context)); 694 function, context));
@@ -731,20 +712,13 @@ acpi_status acpi_os_execute(acpi_execute_type type,
731 dpc->function = function; 712 dpc->function = function;
732 dpc->context = context; 713 dpc->context = context;
733 714
734 if (type == OSL_NOTIFY_HANDLER) { 715 INIT_WORK(&dpc->work, acpi_os_execute_deferred);
735 INIT_WORK(&dpc->work, acpi_os_execute_notify); 716 queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq;
736 if (!queue_work(kacpi_notify_wq, &dpc->work)) { 717 if (!queue_work(queue, &dpc->work)) {
737 status = AE_ERROR; 718 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
738 kfree(dpc); 719 "Call to queue_work() failed.\n"));
739 } 720 status = AE_ERROR;
740 } else { 721 kfree(dpc);
741 INIT_WORK(&dpc->work, acpi_os_execute_deferred);
742 if (!queue_work(kacpid_wq, &dpc->work)) {
743 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
744 "Call to queue_work() failed.\n"));
745 status = AE_ERROR;
746 kfree(dpc);
747 }
748 } 722 }
749 return_ACPI_STATUS(status); 723 return_ACPI_STATUS(status);
750} 724}