]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW
authorYicheng Li <yichengli@chromium.org>
Mon, 3 Feb 2020 22:53:56 +0000 (14:53 -0800)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tue, 11 Feb 2020 09:32:54 +0000 (10:32 +0100)
commit42cd0ab476e2daffc23982c37822a78f9a53cdd5
treea3e23f5aefe06fda06c771bf1ba979aec1c66db7
parent8673e944b50ec6e5afd4f599cf12b2798b629f3d
platform/chrome: cros_ec: Query EC protocol version if EC transitions between RO/RW

RO and RW of EC may have different EC protocol version. If EC transitions
between RO and RW, but AP does not reboot (this is true for fingerprint
microcontroller / cros_fp, but not true for main ec / cros_ec), the AP
still uses the protocol version queried before transition, which can
cause problems. In the case of fingerprint microcontroller, this causes
AP to send the wrong version of EC_CMD_GET_NEXT_EVENT to RO in the
interrupt handler, which in turn prevents RO to clear the interrupt
line to AP, in an infinite loop.

Once an EC_HOST_EVENT_INTERFACE_READY is received, we know that there
might have been a transition between RO and RW, so re-query the protocol.

Signed-off-by: Yicheng Li <yichengli@chromium.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/cros_ec.c
include/linux/platform_data/cros_ec_proto.h