ec/acpi: Return error codes on timeout
commitcb3c368385307b23bf6597ee3c2f6bb9395ed11e
authorAbel Briggs <abelbriggs1@hotmail.com>
Sat, 14 May 2022 15:49:23 +0000 (14 10:49 -0500)
committerMartin L Roth <gaumless@tutanota.com>
Fri, 24 Jun 2022 03:04:23 +0000 (24 03:04 +0000)
tree831e91caf38406d65a68b2eef46bade9fdad2f00
parentccfbfdf0bbd642617e6a33779846cbff585516c7
ec/acpi: Return error codes on timeout

The `send` and `recv` API functions currently print error messages
if a timeout occurs while polling the EC, but they perform the I/O
transaction regardless. This can put the EC in a bad state or
otherwise invoke undefined hardware behavior.

Most callers ignore the return value currently, but for callers
which do not, we should make sure our behavior is correct.

Signed-off-by: Abel Briggs <abelbriggs1@hotmail.com>
Change-Id: Ifb87dd1ac869807fd08463bd8fef36d0389b325e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64350
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
src/ec/acpi/ec.c
src/ec/acpi/ec.h