aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2015-02-05 02:20:22 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-02-05 09:31:38 -0500
commit779ba5a39214f0e3112bd2b94c26df03dc518a29 (patch)
treec2cf09c27c7c7fc8ad3c2dfe04475fd788768fe6
parentc539251e7c1537c8b3dcaa1c89f5393d04996013 (diff)
ACPICA: Events: Cleanup to move acpi_gbl_global_event_handler invocation out of acpi_ev_gpe_dispatch()
ACPICA commit 04f25acdd4f655ae33f83de789bb5f4b7790171c This patch follows acpi_ev_fixed_event_detect(), which invokes acpi_gbl_global_event_handler instead of invoking it in acpi_ev_fixed_event_dispatch(), moves acpi_gbl_global_event_handler from acpi_ev_gpe_dispatch() to acpi_ev_gpe_detect(). This makes further cleanups around acpi_ev_gpe_dispatch() simpler. Lv Zheng. Link: https://github.com/acpica/acpica/commit/04f25acd Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/evgpe.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index d8b919a7c9ad..4a4f41a2822e 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -328,7 +328,10 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
328{ 328{
329 acpi_status status; 329 acpi_status status;
330 struct acpi_gpe_block_info *gpe_block; 330 struct acpi_gpe_block_info *gpe_block;
331 struct acpi_namespace_node *gpe_device;
331 struct acpi_gpe_register_info *gpe_register_info; 332 struct acpi_gpe_register_info *gpe_register_info;
333 struct acpi_gpe_event_info *gpe_event_info;
334 u32 gpe_number;
332 u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; 335 u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
333 u8 enabled_status_byte; 336 u8 enabled_status_byte;
334 u32 status_reg; 337 u32 status_reg;
@@ -356,6 +359,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
356 359
357 gpe_block = gpe_xrupt_list->gpe_block_list_head; 360 gpe_block = gpe_xrupt_list->gpe_block_list_head;
358 while (gpe_block) { 361 while (gpe_block) {
362 gpe_device = gpe_block->node;
363
359 /* 364 /*
360 * Read all of the 8-bit GPE status and enable registers in this GPE 365 * Read all of the 8-bit GPE status and enable registers in this GPE
361 * block, saving all of them. Find all currently active GP events. 366 * block, saving all of them. Find all currently active GP events.
@@ -431,16 +436,33 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
431 436
432 /* Examine one GPE bit */ 437 /* Examine one GPE bit */
433 438
439 gpe_event_info =
440 &gpe_block->
441 event_info[((acpi_size) i *
442 ACPI_GPE_REGISTER_WIDTH) + j];
443 gpe_number =
444 j + gpe_register_info->base_gpe_number;
445
434 if (enabled_status_byte & (1 << j)) { 446 if (enabled_status_byte & (1 << j)) {
447
448 /* Invoke global event handler if present */
449
450 acpi_gpe_count++;
451 if (acpi_gbl_global_event_handler) {
452 acpi_gbl_global_event_handler
453 (ACPI_EVENT_TYPE_GPE,
454 gpe_device, gpe_number,
455 acpi_gbl_global_event_handler_context);
456 }
457
435 /* 458 /*
436 * Found an active GPE. Dispatch the event to a handler 459 * Found an active GPE. Dispatch the event to a handler
437 * or method. 460 * or method.
438 */ 461 */
439 int_status |= 462 int_status |=
440 acpi_ev_gpe_dispatch(gpe_block-> 463 acpi_ev_gpe_dispatch(gpe_device,
441 node, 464 gpe_event_info,
442 &gpe_block-> 465 gpe_number);
443 event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number);
444 } 466 }
445 } 467 }
446 } 468 }
@@ -645,15 +667,6 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
645 667
646 ACPI_FUNCTION_TRACE(ev_gpe_dispatch); 668 ACPI_FUNCTION_TRACE(ev_gpe_dispatch);
647 669
648 /* Invoke global event handler if present */
649
650 acpi_gpe_count++;
651 if (acpi_gbl_global_event_handler) {
652 acpi_gbl_global_event_handler(ACPI_EVENT_TYPE_GPE, gpe_device,
653 gpe_number,
654 acpi_gbl_global_event_handler_context);
655 }
656
657 /* 670 /*
658 * Always disable the GPE so that it does not keep firing before 671 * Always disable the GPE so that it does not keep firing before
659 * any asynchronous activity completes (either from the execution 672 * any asynchronous activity completes (either from the execution