未验证 提交 3abc16af 编写于 作者: P Patryk Duda 提交者: Benson Leung

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: <stable@vger.kernel.org> # 4.4+
Signed-off-by: NPatryk Duda <pdk@semihalf.com>
Link: https://lore.kernel.org/r/20210518140758.29318-1-pdk@semihalf.comSigned-off-by: NBenson Leung <bleung@chromium.org>
上级 d453ceb6
...@@ -279,6 +279,15 @@ static int cros_ec_host_command_proto_query(struct cros_ec_device *ec_dev, ...@@ -279,6 +279,15 @@ static int cros_ec_host_command_proto_query(struct cros_ec_device *ec_dev,
msg->insize = sizeof(struct ec_response_get_protocol_info); msg->insize = sizeof(struct ec_response_get_protocol_info);
ret = send_command(ec_dev, msg); ret = send_command(ec_dev, msg);
/*
* Send command once again when timeout occurred.
* Fingerprint MCU (FPMCU) is restarted during system boot which
* introduces small window in which FPMCU won't respond for any
* messages sent by kernel. There is no need to wait before next
* attempt because we waited at least EC_MSG_DEADLINE_MS.
*/
if (ret == -ETIMEDOUT)
ret = send_command(ec_dev, msg);
if (ret < 0) { if (ret < 0) {
dev_dbg(ec_dev->dev, dev_dbg(ec_dev->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册