aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2017-09-26 04:54:03 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-11-08 18:23:53 -0500
commit53c5eaabaea9a1b7a96f95ccc486d2ad721d95bb (patch)
tree7bbb306296832c6ae211170cd82bbc1fae66acac
parent39dae59d66acd86d1de24294bd2f343fd5e7a625 (diff)
ACPI / EC: Fix regression related to triggering source of EC event handling
Originally the Samsung quirks removed by commit 4c237371 can be covered by commit e923e8e7 and ec_freeze_events=Y mode. But commit 9c40f956 changed ec_freeze_events=Y back to N, making this problem re-surface. Actually, if commit e923e8e7 is robust enough, we can freely change ec_freeze_events mode, so this patch fixes the issue by improving commit e923e8e7. Related commits listed in the merged order: Commit: e923e8e79e18fd6be9162f1be6b99a002e9df2cb Subject: ACPI / EC: Fix an issue that SCI_EVT cannot be detected after event is enabled Commit: 4c237371f290d1ed3b2071dd43554362137b1cce Subject: ACPI / EC: Remove old CLEAR_ON_RESUME quirk Commit: 9c40f956ce9b331493347d1b3cb7e384f7dc0581 Subject: Revert "ACPI / EC: Enable event freeze mode..." to fix a regression This patch not only fixes the reported post-resume EC event triggering source issue, but also fixes an unreported similar issue related to the driver bind by adding EC event triggering source in ec_install_handlers(). Fixes: e923e8e79e18 (ACPI / EC: Fix an issue that SCI_EVT cannot be detected after event is enabled) Fixes: 4c237371f290 (ACPI / EC: Remove old CLEAR_ON_RESUME quirk) Fixes: 9c40f956ce9b (Revert "ACPI / EC: Enable event freeze mode..." to fix a regression) Link: https://bugzilla.kernel.org/show_bug.cgi?id=196833 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Reported-by: Alistair Hamilton <ahpatent@gmail.com> Tested-by: Alistair Hamilton <ahpatent@gmail.com> Cc: 4.11+ <stable@vger.kernel.org> # 4.11+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/ec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 236b14324780..82b3ce5e937e 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -486,8 +486,11 @@ static inline void __acpi_ec_enable_event(struct acpi_ec *ec)
486{ 486{
487 if (!test_and_set_bit(EC_FLAGS_QUERY_ENABLED, &ec->flags)) 487 if (!test_and_set_bit(EC_FLAGS_QUERY_ENABLED, &ec->flags))
488 ec_log_drv("event unblocked"); 488 ec_log_drv("event unblocked");
489 if (!test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) 489 /*
490 advance_transaction(ec); 490 * Unconditionally invoke this once after enabling the event
491 * handling mechanism to detect the pending events.
492 */
493 advance_transaction(ec);
491} 494}
492 495
493static inline void __acpi_ec_disable_event(struct acpi_ec *ec) 496static inline void __acpi_ec_disable_event(struct acpi_ec *ec)
@@ -1456,11 +1459,10 @@ static int ec_install_handlers(struct acpi_ec *ec, bool handle_events)
1456 if (test_bit(EC_FLAGS_STARTED, &ec->flags) && 1459 if (test_bit(EC_FLAGS_STARTED, &ec->flags) &&
1457 ec->reference_count >= 1) 1460 ec->reference_count >= 1)
1458 acpi_ec_enable_gpe(ec, true); 1461 acpi_ec_enable_gpe(ec, true);
1459
1460 /* EC is fully operational, allow queries */
1461 acpi_ec_enable_event(ec);
1462 } 1462 }
1463 } 1463 }
1464 /* EC is fully operational, allow queries */
1465 acpi_ec_enable_event(ec);
1464 1466
1465 return 0; 1467 return 0;
1466} 1468}