Comment 165 for bug 1283589

Revision history for this message
In , clancy.kieran+kernel (clancy.kieran+kernel-linux-kernel-bugs) wrote :

Created attachment 127121
acpi_ec_clear function, only run on affected hardware

There is already a function which runs on resume, namely acpi_ec_unblock_transactions(). This patch uses that function rather than setting up a new hook to be run on wake.

To avoid potential side-effects on non-Samsung hardware, I have also added DMI info which is checked along with other quirks when the ACPI bus is initialised. If the system vendor is Samsung, the flag EC_FLAGS_CLEAR_ON_RESUME is set to 1.

When the system resumes and acpi_ec_unblock_transactions() is run, this flag is checked and acpi_ec_clear() is run if necessary.

Finally, acpi_ec_clear() is also run if needed when the EC is finalised in acpi_ec_add(), in case the EC was jammed when the system boots. Otherwise the EC wouldn't be cleared until a manual suspend+resume (which may not happen often, or at all, depending on the user).

I'd also like to reiterate that we should ideally find out how to stop the EC filling during suspend, since this:
a) would prevent problems if resume never happens and another operating system is booted which doesn't clear the EC (e.g. Windows, or a Linux kernel prior to this patch)
b) may reduce power consumption while in sleep - perhaps the EC or other hardware is supposed to be put in a lower power state as part of this process