aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2008-10-25 13:48:46 -0400
committerLen Brown <len.brown@intel.com>2008-11-11 18:35:42 -0500
commit0b7084ac67fb84f0cf2f8bc02d7e0dea8521dd2d (patch)
tree0a619ac7a700543e6ba69aa5a568e5678ec0603d /drivers/acpi/ec.c
parenta2f93aeadf97e870ff385030633a73e21146815d (diff)
ACPICA: Use spinlock for acpi_{en|dis}able_gpe
Disabling gpe might interfere with gpe detection/handling, thus producing "interrupt not handled" errors. Ironically, disabling of GPE from interrupt context is already under spinlock, so only userspace needs to start using it. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 34c67ca3bebe..89d6d2868e8c 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -282,7 +282,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
282 /* disable GPE during transaction if storm is detected */ 282 /* disable GPE during transaction if storm is detected */
283 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) { 283 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
284 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 284 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
285 acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 285 acpi_disable_gpe(NULL, ec->gpe);
286 } 286 }
287 /* start transaction */ 287 /* start transaction */
288 spin_lock_irqsave(&ec->curr_lock, tmp); 288 spin_lock_irqsave(&ec->curr_lock, tmp);
@@ -305,7 +305,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
305 /* check if we received SCI during transaction */ 305 /* check if we received SCI during transaction */
306 ec_check_sci(ec, acpi_ec_read_status(ec)); 306 ec_check_sci(ec, acpi_ec_read_status(ec));
307 /* it is safe to enable GPE outside of transaction */ 307 /* it is safe to enable GPE outside of transaction */
308 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 308 acpi_enable_gpe(NULL, ec->gpe);
309 } else if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags) && 309 } else if (test_bit(EC_FLAGS_GPE_MODE, &ec->flags) &&
310 t->irq_count > ACPI_EC_STORM_THRESHOLD) { 310 t->irq_count > ACPI_EC_STORM_THRESHOLD) {
311 pr_info(PREFIX "GPE storm detected, " 311 pr_info(PREFIX "GPE storm detected, "
@@ -897,7 +897,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
897 if (ACPI_FAILURE(status)) 897 if (ACPI_FAILURE(status))
898 return -ENODEV; 898 return -ENODEV;
899 acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); 899 acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME);
900 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 900 acpi_enable_gpe(NULL, ec->gpe);
901 status = acpi_install_address_space_handler(ec->handle, 901 status = acpi_install_address_space_handler(ec->handle,
902 ACPI_ADR_SPACE_EC, 902 ACPI_ADR_SPACE_EC,
903 &acpi_ec_space_handler, 903 &acpi_ec_space_handler,
@@ -1036,7 +1036,7 @@ static int acpi_ec_suspend(struct acpi_device *device, pm_message_t state)
1036 /* Stop using GPE */ 1036 /* Stop using GPE */
1037 set_bit(EC_FLAGS_NO_GPE, &ec->flags); 1037 set_bit(EC_FLAGS_NO_GPE, &ec->flags);
1038 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags); 1038 clear_bit(EC_FLAGS_GPE_MODE, &ec->flags);
1039 acpi_disable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 1039 acpi_disable_gpe(NULL, ec->gpe);
1040 return 0; 1040 return 0;
1041} 1041}
1042 1042
@@ -1045,7 +1045,7 @@ static int acpi_ec_resume(struct acpi_device *device)
1045 struct acpi_ec *ec = acpi_driver_data(device); 1045 struct acpi_ec *ec = acpi_driver_data(device);
1046 /* Enable use of GPE back */ 1046 /* Enable use of GPE back */
1047 clear_bit(EC_FLAGS_NO_GPE, &ec->flags); 1047 clear_bit(EC_FLAGS_NO_GPE, &ec->flags);
1048 acpi_enable_gpe(NULL, ec->gpe, ACPI_NOT_ISR); 1048 acpi_enable_gpe(NULL, ec->gpe);
1049 return 0; 1049 return 0;
1050} 1050}
1051 1051