aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-06-24 19:21:42 -0400
committerLen Brown <len.brown@intel.com>2010-07-06 22:34:27 -0400
commit3784730b02b9f147a55b0e4623fcad671273e6e6 (patch)
treecd00f3da44529154938d6c831f1302685a124639 /drivers/acpi/ec.c
parentb63559f5ce08bc8f94ce144a8d06f7af607ecc53 (diff)
ACPI / EC: Do not use acpi_set_gpe
The EC driver is the last user of acpi_set_gpe() and since it is guaranteed that the EC GPE will not be shared, acpi_disable_gpe() and acpi_enable_gpe() may be used for disabling the GPE temporarilty if a GPE storm is detected and re-enabling it during EC transactions. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 9bf7a7546bd4..1e6d4184f0ea 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -313,11 +313,8 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
313 pr_debug(PREFIX "transaction start\n"); 313 pr_debug(PREFIX "transaction start\n");
314 /* disable GPE during transaction if storm is detected */ 314 /* disable GPE during transaction if storm is detected */
315 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) { 315 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
316 /* 316 /* It has to be disabled, so that it doesn't trigger. */
317 * It has to be disabled at the hardware level regardless of the 317 acpi_disable_gpe(NULL, ec->gpe);
318 * GPE reference counting, so that it doesn't trigger.
319 */
320 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE);
321 } 318 }
322 319
323 status = acpi_ec_transaction_unlocked(ec, t); 320 status = acpi_ec_transaction_unlocked(ec, t);
@@ -326,12 +323,8 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
326 ec_check_sci_sync(ec, acpi_ec_read_status(ec)); 323 ec_check_sci_sync(ec, acpi_ec_read_status(ec));
327 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) { 324 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
328 msleep(1); 325 msleep(1);
329 /* 326 /* It is safe to enable the GPE outside of the transaction. */
330 * It is safe to enable the GPE outside of the transaction. Use 327 acpi_enable_gpe(NULL, ec->gpe);
331 * acpi_set_gpe() for that, since we used it to disable the GPE
332 * above.
333 */
334 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE);
335 } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) { 328 } else if (t->irq_count > ACPI_EC_STORM_THRESHOLD) {
336 pr_info(PREFIX "GPE storm detected, " 329 pr_info(PREFIX "GPE storm detected, "
337 "transactions will use polling mode\n"); 330 "transactions will use polling mode\n");