Skip to content

Commit 3abc16a

Browse files
duda-patrykbleungatchromium
authored andcommitted
platform/chrome: cros_ec_proto: Send command again when timeout occurs
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: <[email protected]> # 4.4+ Signed-off-by: Patryk Duda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benson Leung <[email protected]>
1 parent d453ceb commit 3abc16a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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)