aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLuming Yu <luming.yu@intel.com>2005-04-22 23:07:10 -0400
committerLen Brown <len.brown@intel.com>2005-07-12 00:12:53 -0400
commit17e9c78a75ce9eacd61200f9e1f1924012e28846 (patch)
treed9d8f1c19eaa45ec419b76d5ec1bdad27a1451e6 /drivers
parenta27ac38efd6dc6dccebfc9bcc475ab4aa5fc4a56 (diff)
[ACPI] EC GPE-disabled issue
http://bugzilla.kernel.org/show_bug.cgi?id=3851 Signed-off-by: Luming Yu <luming.yu@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/ec.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index a4b70dfdcf04..8e665f2e3138 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -282,7 +282,7 @@ end:
282 282
283 if(atomic_read(&ec->leaving_burst) == 2){ 283 if(atomic_read(&ec->leaving_burst) == 2){
284 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); 284 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n"));
285 while(!atomic_read(&ec->pending_gpe)){ 285 while(atomic_read(&ec->pending_gpe)){
286 msleep(1); 286 msleep(1);
287 } 287 }
288 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); 288 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
@@ -365,7 +365,7 @@ end:
365 365
366 if(atomic_read(&ec->leaving_burst) == 2){ 366 if(atomic_read(&ec->leaving_burst) == 2){
367 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); 367 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n"));
368 while(!atomic_read(&ec->pending_gpe)){ 368 while(atomic_read(&ec->pending_gpe)){
369 msleep(1); 369 msleep(1);
370 } 370 }
371 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); 371 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
@@ -431,7 +431,6 @@ acpi_ec_query (
431 431
432 if (!ec || !data) 432 if (!ec || !data)
433 return_VALUE(-EINVAL); 433 return_VALUE(-EINVAL);
434retry:
435 *data = 0; 434 *data = 0;
436 435
437 if (ec->global_lock) { 436 if (ec->global_lock) {
@@ -469,13 +468,9 @@ end:
469 468
470 if(atomic_read(&ec->leaving_burst) == 2){ 469 if(atomic_read(&ec->leaving_burst) == 2){
471 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n")); 470 ACPI_DEBUG_PRINT((ACPI_DB_INFO,"aborted, retry ...\n"));
472 while(!atomic_read(&ec->pending_gpe)){
473 msleep(1);
474 }
475 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR); 471 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
476 goto retry; 472 status = -ENODATA;
477 } 473 }
478
479 return_VALUE(status); 474 return_VALUE(status);
480} 475}
481 476
@@ -514,8 +509,8 @@ acpi_ec_gpe_query (
514 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name)); 509 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s\n", object_name));
515 510
516 acpi_evaluate_object(ec->handle, object_name, NULL, NULL); 511 acpi_evaluate_object(ec->handle, object_name, NULL, NULL);
517 atomic_dec(&ec->pending_gpe);
518end: 512end:
513 atomic_dec(&ec->pending_gpe);
519 return; 514 return;
520} 515}
521 516
@@ -553,7 +548,7 @@ acpi_ec_gpe_handler (
553 !(value & ACPI_EC_FLAG_IBF))) { 548 !(value & ACPI_EC_FLAG_IBF))) {
554 ec->expect_event = 0; 549 ec->expect_event = 0;
555 wake_up(&ec->wait); 550 wake_up(&ec->wait);
556 551 return ACPI_INTERRUPT_HANDLED;
557 } 552 }
558 } 553 }
559 554
@@ -561,8 +556,10 @@ acpi_ec_gpe_handler (
561 atomic_add(1, &ec->pending_gpe) ; 556 atomic_add(1, &ec->pending_gpe) ;
562 status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE, 557 status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
563 acpi_ec_gpe_query, ec); 558 acpi_ec_gpe_query, ec);
559 return status == AE_OK ?
560 ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
564 } 561 }
565 562 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_ISR);
566 return status == AE_OK ? 563 return status == AE_OK ?
567 ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED; 564 ACPI_INTERRUPT_HANDLED : ACPI_INTERRUPT_NOT_HANDLED;
568} 565}
@@ -688,6 +685,7 @@ acpi_ec_read_info (struct seq_file *seq, void *offset)
688 (u32) ec->status_addr.address, (u32) ec->data_addr.address); 685 (u32) ec->status_addr.address, (u32) ec->data_addr.address);
689 seq_printf(seq, "use global lock: %s\n", 686 seq_printf(seq, "use global lock: %s\n",
690 ec->global_lock?"yes":"no"); 687 ec->global_lock?"yes":"no");
688 acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
691 689
692end: 690end:
693 return_VALUE(0); 691 return_VALUE(0);