Skip to content

Commit 53c5eaa

Browse files
Lv Zhengrafaeljw
authored andcommitted
ACPI / EC: Fix regression related to triggering source of EC event handling
Originally the Samsung quirks removed by commit 4c23737 can be covered by commit e923e8e and ec_freeze_events=Y mode. But commit 9c40f95 changed ec_freeze_events=Y back to N, making this problem re-surface. Actually, if commit e923e8e is robust enough, we can freely change ec_freeze_events mode, so this patch fixes the issue by improving commit e923e8e. Related commits listed in the merged order: Commit: e923e8e Subject: ACPI / EC: Fix an issue that SCI_EVT cannot be detected after event is enabled Commit: 4c23737 Subject: ACPI / EC: Remove old CLEAR_ON_RESUME quirk Commit: 9c40f95 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: e923e8e (ACPI / EC: Fix an issue that SCI_EVT cannot be detected after event is enabled) Fixes: 4c23737 (ACPI / EC: Remove old CLEAR_ON_RESUME quirk) Fixes: 9c40f95 (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>
1 parent 39dae59 commit 53c5eaa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/acpi/ec.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,11 @@ static inline void __acpi_ec_enable_event(struct acpi_ec *ec)
486486
{
487487
if (!test_and_set_bit(EC_FLAGS_QUERY_ENABLED, &ec->flags))
488488
ec_log_drv("event unblocked");
489-
if (!test_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
490-
advance_transaction(ec);
489+
/*
490+
* Unconditionally invoke this once after enabling the event
491+
* handling mechanism to detect the pending events.
492+
*/
493+
advance_transaction(ec);
491494
}
492495

493496
static 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)
14561459
if (test_bit(EC_FLAGS_STARTED, &ec->flags) &&
14571460
ec->reference_count >= 1)
14581461
acpi_ec_enable_gpe(ec, true);
1459-
1460-
/* EC is fully operational, allow queries */
1461-
acpi_ec_enable_event(ec);
14621462
}
14631463
}
1464+
/* EC is fully operational, allow queries */
1465+
acpi_ec_enable_event(ec);
14641466

14651467
return 0;
14661468
}

0 commit comments

Comments
 (0)