diff options
-rw-r--r-- | drivers/acpi/ec.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index c24235d8fb52..30d7f8294f90 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -459,8 +459,10 @@ static bool acpi_ec_submit_flushable_request(struct acpi_ec *ec) | |||
459 | 459 | ||
460 | static void acpi_ec_submit_query(struct acpi_ec *ec) | 460 | static void acpi_ec_submit_query(struct acpi_ec *ec) |
461 | { | 461 | { |
462 | if (acpi_ec_event_enabled(ec) && | 462 | acpi_ec_set_storm(ec, EC_FLAGS_COMMAND_STORM); |
463 | !test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { | 463 | if (!acpi_ec_event_enabled(ec)) |
464 | return; | ||
465 | if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { | ||
464 | ec_dbg_evt("Command(%s) submitted/blocked", | 466 | ec_dbg_evt("Command(%s) submitted/blocked", |
465 | acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); | 467 | acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); |
466 | ec->nr_pending_queries++; | 468 | ec->nr_pending_queries++; |
@@ -470,11 +472,10 @@ static void acpi_ec_submit_query(struct acpi_ec *ec) | |||
470 | 472 | ||
471 | static void acpi_ec_complete_query(struct acpi_ec *ec) | 473 | static void acpi_ec_complete_query(struct acpi_ec *ec) |
472 | { | 474 | { |
473 | if (test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { | 475 | if (test_and_clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) |
474 | clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); | ||
475 | ec_dbg_evt("Command(%s) unblocked", | 476 | ec_dbg_evt("Command(%s) unblocked", |
476 | acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); | 477 | acpi_ec_cmd_string(ACPI_EC_COMMAND_QUERY)); |
477 | } | 478 | acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM); |
478 | } | 479 | } |
479 | 480 | ||
480 | static inline void __acpi_ec_enable_event(struct acpi_ec *ec) | 481 | static inline void __acpi_ec_enable_event(struct acpi_ec *ec) |