From: Greg Kroah-Hartman Date: Thu, 16 Sep 2021 13:13:59 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.10.67~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17927aece840b804d59fe61e26df1dbdf46516a7;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: platform-chrome-cros_ec_proto-send-command-again-when-timeout-occurs.patch --- diff --git a/queue-4.4/platform-chrome-cros_ec_proto-send-command-again-when-timeout-occurs.patch b/queue-4.4/platform-chrome-cros_ec_proto-send-command-again-when-timeout-occurs.patch new file mode 100644 index 00000000000..4f753586747 --- /dev/null +++ b/queue-4.4/platform-chrome-cros_ec_proto-send-command-again-when-timeout-occurs.patch @@ -0,0 +1,41 @@ +From 3abc16af57c9939724df92fcbda296b25cc95168 Mon Sep 17 00:00:00 2001 +From: Patryk Duda +Date: Tue, 18 May 2021 16:07:58 +0200 +Subject: platform/chrome: cros_ec_proto: Send command again when timeout occurs + +From: Patryk Duda + +commit 3abc16af57c9939724df92fcbda296b25cc95168 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: # 4.4+ +Signed-off-by: Patryk Duda +Link: https://lore.kernel.org/r/20210518140758.29318-1-pdk@semihalf.com +Signed-off-by: Benson Leung +Signed-off-by: Greg Kroah-Hartman +--- + drivers/platform/chrome/cros_ec_proto.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/platform/chrome/cros_ec_proto.c ++++ b/drivers/platform/chrome/cros_ec_proto.c +@@ -182,6 +182,15 @@ static int cros_ec_host_command_proto_qu + 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, diff --git a/queue-4.4/series b/queue-4.4/series index 1e4db126390..1129defe8ae 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -114,3 +114,4 @@ parport-remove-non-zero-check-on-count.patch ath9k-fix-oob-read-ar9300_eeprom_restore_internal.patch net-fix-null-pointer-reference-in-cipso_v4_doi_free.patch parisc-fix-crash-with-signals-and-alloca.patch +platform-chrome-cros_ec_proto-send-command-again-when-timeout-occurs.patch