summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2021-07-15 02:20:41 -0400
committerCommit Bot <commit-bot@chromium.org>2021-07-16 17:36:18 +0000
commit6e4ed0664ef649b0170894cc2ac1a738d3673ce1 (patch)
tree5d9a0923b0663b317fb73e3348febd8414c27bf2 /util
parentb0e93341bc75ff677afa520322fb61eaac98c4f1 (diff)
downloadchrome-ec-6e4ed0664ef649b0170894cc2ac1a738d3673ce1.tar.gz
flash_fp_mcu: Fix interrupt to unbind race caused by pwr_en
Taking control of the pwr_en line causes the FPMCU to power cycle. This causes an interrupt to the cros-ec driver. The interrupt handler then races with the subsequent cros-ec unbind attempt. This can manifest in multiple ways, but one common way is for the later binding of spidev to fail, since the interrupt handler reinitialized the cros-ec driver (due to crrev.com/c/1903814). The spidev attempt then errors out because there are still resources associated with the device (the reallocated cros-ec objects). The need to take control of the power enable line to simply keep FPMCU power enabled is no longer needed on any device. * The need for this arose during nocturne development, when the pwr_en line was associated with the SPI interface in ACPI. This can be seen in https://crrev.com/c/1084686. This pwr_en control was then added to flash_fp_mcu in https://crrev.com/c/1114743. * The pwr_line was then quickly disassociated with the SPI interface a few days later in https://crrev.com/c/1155565, but wasn't removed from flash_fp_mcu. To this day, the FP pwr_en line is controlled in coreboot manually. It remains powered on when the Chromebook is powered on, irrespective of drivers. BRANCH=none BUG=b:190744837 TEST=Run the following on nocturne, nami, kohaku, dratini, and volteer. scp util/flash_fp_mcu ${DUT_HOSTNAME}:/usr/local/bin/flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello ssh ${DUT_HOSTNAME} flash_fp_mcu ssh ${DUT_HOSTNAME} flash_fp_mcu --hello Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Icc64f7056e21180efd19b2f650b9fe5804cd2906 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3027129 Tested-by: Patryk Duda <patrykd@google.com> Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Josie Nordrum <josienordrum@google.com>
Diffstat (limited to 'util')
-rw-r--r--util/flash_fp_mcu12
1 files changed, 0 insertions, 12 deletions
diff --git a/util/flash_fp_mcu b/util/flash_fp_mcu
index 827aa398de..85ab64dfc5 100644
--- a/util/flash_fp_mcu
+++ b/util/flash_fp_mcu
@@ -299,13 +299,6 @@ flash_fp_mcu_stm32() {
echo "Flashing ${transport} device ID: ${deviceid}"
- # Ensure the ACPI is not cutting power when unloading cros-ec-spi
- if [[ "${gpio_pwren}" -gt 0 ]]; then
- gpio export "${gpio_pwren}"
- gpio out "${gpio_pwren}"
- gpio 1 "${gpio_pwren}"
- fi
-
# Remove cros_fp if present
klog "Unbinding cros-ec driver"
if [[ "${transport}" == "UART" ]]; then
@@ -409,11 +402,6 @@ flash_fp_mcu_stm32() {
klog "Binding cros-ec driver"
echo "" > "/sys/bus/spi/devices/${deviceid}/driver_override"
echo "${deviceid}" > /sys/bus/spi/drivers/cros-ec-spi/bind
-
- # Kernel driver is back, we are no longer controlling power
- if [[ "${gpio_pwren}" -gt 0 ]]; then
- gpio unexport "${gpio_pwren}"
- fi
fi
if [[ "${cmd_exit_status}" -ne 0 ]]; then