ACPI: EC: Fix acpi_ec_dispatch_gpe()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 27 Jun 2023 14:35:52 +0000 (16:35 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 27 Jun 2023 15:06:51 +0000 (17:06 +0200)
commitb5539eb5ee70257520e40bb636a295217c329a50
tree4ec845bc4cc1ff96763d168e855730c54774d29c
parentbb6950556d4b1dd1226c1f09e84b53cb37e5340f
ACPI: EC: Fix acpi_ec_dispatch_gpe()

Commit 896e97bf99ec ("ACPI: EC: Clear GPE on interrupt handling only")
broke suspend-to-idle at least on Dell XPS13 9360 and 9380.

The problem is that acpi_ec_dispatch_gpe() must clear the EC GPE,
because the EC GPE handler never runs when the system is in the
suspend-to-idle state and if the EC GPE is not cleared by the suspend-
to-idle loop, it is never cleared at all which leads to a GPE storm.
This causes suspend-to-idle to burn energy instead of saving it which
is potentially dangerous (the affected machines heat up rather badly
when that happens).

Addess this by making acpi_ec_dispatch_gpe() clear the EC GPE as it did
before.

Fixes: 896e97bf99ec ("ACPI: EC: Clear GPE on interrupt handling only")
Tested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c