Merge tag 'io_uring-5.15-2021-09-11' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / drivers / platform / chrome / cros_ec_proto.c
index aa7f7aa..a7404d6 100644 (file)
@@ -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);
 
        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) {
                dev_dbg(ec_dev->dev,