ACPI: EC: Call advance_transaction() from acpi_ec_dispatch_gpe()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 23 Nov 2021 18:37:39 +0000 (19:37 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 1 Dec 2021 19:17:32 +0000 (20:17 +0100)
commitca8283dcd933a2ca776fade77fb4527321521463
tree33ce0de9ee41d357e5a43c907f43c7394ce1b8c8
parent4a9af6cac050dce2e895ec3205c4615383ad9112
ACPI: EC: Call advance_transaction() from acpi_ec_dispatch_gpe()

Calling acpi_dispatch_gpe() from acpi_ec_dispatch_gpe() is generally
problematic, because it may cause the spurious interrupt handling in
advance_transaction() to trigger in theory.

However, instead of calling acpi_dispatch_gpe() to dispatch the EC
GPE, acpi_ec_dispatch_gpe() can call advance_transaction() directly
on first_ec and it can pass 'false' as its second argument to indicate
calling it from process context.

Moreover, if advance_transaction() is modified to return a bool value
indicating whether or not the EC work needs to be flushed, it can be
used to avoid unnecessary EC work flushing in acpi_ec_dispatch_gpe(),
so change the code accordingly.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/ec.c