summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2019-11-19 11:08:51 -0800
committerPhilip Chen <philipchen@chromium.org>2020-02-10 19:37:09 +0000
commit5a75964d9b34ee4f76bb13e8372a80dafa4ab7b2 (patch)
tree5e25f19308d6647aa716b222f17e3f4fe385d22b
parent9fb7f7d476c2e651495448dc8d99273cf56c74ca (diff)
downloadchrome-ec-5a75964d9b34ee4f76bb13e8372a80dafa4ab7b2.tar.gz
flash_fp_mcu: Fix spidev flakiness
This small 100ms sleep is necessary to stabilize the spidev driver. Without it, we have seen that stm32mon is unable to catch the stm32h743 bootloader on the first attempt. This issue became more noticeable with the STM32H743 Rev V. Among other things, the following log shows test results from before adding this sleep and the flash_fp_mcu stress test results after adding this sleep: https://drive.google.com/open?id=1opJn5fPXxUMjMZz0VDtmqpCXN0mVnBr5 BRANCH=nocturne,hatch BUG=b:143374692,b:144729003,b:135033816 TEST=# Ensure PS crrev.com/c/1921705 is applied. # Run http://go/bit/hesling/5791510394044416 TEST=See the testing done in the above Google Drive log. Change-Id: I1777c894e1dd8911df4d407e33dc677373146eb1 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925174 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> (cherry picked from commit b80e142133ed2ea5ff5e604c9fedbaa520f22a45) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2047628 Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
-rw-r--r--util/flash_fp_mcu3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index ec317e9413..80b3385c56 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -186,6 +186,9 @@ flash_fp_mcu_stm32() {
# load spidev (fail on cros-ec-spi first to change modalias)
echo "${spiid}" > /sys/bus/spi/drivers/cros-ec-spi/bind 2>/dev/null
echo "${spiid}" > /sys/bus/spi/drivers/spidev/bind
+ # The following sleep is a workaround to mitigate the effects of a
+ # poorly behaved chip select line. See b/145023809.
+ sleep 0.5
local attempt=0
local cmd_exit_status=1