Skip to content

Commit 00cdb2f

Browse files
duda-patrykgregkh
authored andcommitted
platform/chrome: cros_ec_proto: Send command again when timeout occurs
commit 3abc16a upstream. Sometimes kernel is trying to probe Fingerprint MCU (FPMCU) when it hasn't initialized SPI yet. This can happen because FPMCU is restarted during system boot and kernel can send message in short window eg. between sysjump to RW and SPI initialization. Cc: <stable@vger.kernel.org> # 4.4+ Signed-off-by: Patryk Duda <pdk@semihalf.com> Link: https://lore.kernel.org/r/20210518140758.29318-1-pdk@semihalf.com Signed-off-by: Benson Leung <bleung@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b2e72e5 commit 00cdb2f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎drivers/platform/chrome/cros_ec_proto.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,15 @@ static int cros_ec_host_command_proto_query(struct cros_ec_device *ec_dev,
279279
msg->insize = sizeof(struct ec_response_get_protocol_info);
280280

281281
ret = send_command(ec_dev, msg);
282+
/*
283+
* Send command once again when timeout occurred.
284+
* Fingerprint MCU (FPMCU) is restarted during system boot which
285+
* introduces small window in which FPMCU won't respond for any
286+
* messages sent by kernel. There is no need to wait before next
287+
* attempt because we waited at least EC_MSG_DEADLINE_MS.
288+
*/
289+
if (ret == -ETIMEDOUT)
290+
ret = send_command(ec_dev, msg);
282291

283292
if (ret < 0) {
284293
dev_dbg(ec_dev->dev,

0 commit comments

Comments
 (0)