From 5a75964d9b34ee4f76bb13e8372a80dafa4ab7b2 Mon Sep 17 00:00:00 2001 From: Craig Hesling Date: Tue, 19 Nov 2019 11:08:51 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925174 Reviewed-by: Daisuke Nojiri (cherry picked from commit b80e142133ed2ea5ff5e604c9fedbaa520f22a45) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2047628 Reviewed-by: Philip Chen Commit-Queue: Philip Chen Tested-by: Philip Chen --- util/flash_fp_mcu | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.1