Skip to content
Commit 3eba563e authored by Kieran Clancy's avatar Kieran Clancy Committed by Rafael J. Wysocki
Browse files

ACPI / EC: Process rather than discard events in acpi_ec_clear

Address a regression caused by commit ad332c8a:
(ACPI / EC: Clear stale EC events on Samsung systems)

After the earlier patch, there was found to be a race condition on some
earlier Samsung systems (N150/N210/N220). The function acpi_ec_clear was
sometimes discarding a new EC event before its GPE was triggered by the
system. In the case of these systems, this meant that the "lid open"
event was not registered on resume if that was the cause of the wake,
leading to problems when attempting to close the lid to suspend again.

After testing on a number of Samsung systems, both those affected by the
previous EC bug and those affected by the race condition, it seemed that
the best course of action was to process rather than discard the events.
On Samsung systems which accumulate stale EC events, there does not seem
to be any adverse side-effects of running the associated _Q methods.

This patch adds an argument to the static function acpi_ec_sync_query so
that it may be used within the acpi_ec_clear loop in place of
acpi_ec_query_unlocked which was used previously.

With thanks to Stefan Biereigel for reporting the issue, and for all the
people who helped test the new patch on affected systems.

Fixes: ad332c8a (ACPI / EC: Clear stale EC events on Samsung systems)
References: https://lkml.kernel.org/r/532FE3B2.9060808@biereigel-wb.de
References: https://bugzilla.kernel.org/show_bug.cgi?id=44161#c173


Reported-by: default avatarStefan Biereigel <stefan@biereigel.de>
Signed-off-by: default avatarKieran Clancy <clancy.kieran@gmail.com>
Tested-by: default avatarStefan Biereigel <stefan@biereigel.de>
Tested-by: default avatarDennis Jansen <dennis.jansen@web.de>
Tested-by: default avatarNicolas Porcel <nicolasporcel06@gmail.com>
Tested-by: default avatarMaurizio D'Addona <mauritiusdadd@gmail.com>
Tested-by: default avatarJuan Manuel Cabo <juanmanuel.cabo@gmail.com>
Tested-by: default avatarGiannis Koutsou <giannis.koutsou@gmail.com>
Tested-by: default avatarKieran Clancy <clancy.kieran@gmail.com>
Cc: 3.14+ <stable@vger.kernel.org> # 3.14+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d1db0eea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment