platform/chrome: cros_ec_ishtp: skip old cros_ec responses
authorJett Rink <jettrink@chromium.org>
Fri, 10 Apr 2020 16:23:04 +0000 (10:23 -0600)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 13 Apr 2020 14:36:54 +0000 (16:36 +0200)
commit0f706b4fac8b19fd0a4b4fef24dbadb23a3eb0c1
tree370cab6f6b14772495cec5948b5c612a97bb80e3
parentad35da94b61785ddc1186095c3e488c5c0af6bd2
platform/chrome: cros_ec_ishtp: skip old cros_ec responses

The ISHTP layer can give us old responses that we already gave up on. We
do not want to interpret these old responses as the current response we
are waiting for.

The cros_ish should only have one request in flight at a time. We send
the request and wait for the response from the ISH. If the ISH is too
slow to respond we give up on that request and we can send a new
request. The ISH may still send the response to the request that timed
out and without this we treat the old response as the response to the
current command. This is a condition that should not normally happen but
it has been observed with a bad ISH image. So add a token to the request
header which is copied into the response header when the ISH processes
the message to ensure that response is for the current request.

Signed-off-by: Jett Rink <jettrink@chromium.org>
Signed-off-by: Mathew King <mathewk@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/cros_ec_ishtp.c