summaryrefslogtreecommitdiff
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-22 22:12:47 +0000
commit9648407ed0b9f142b1416d8488fa3177f40cff89 (patch)
tree33c21285e258ed1301cd54521895ac8ecdba8a8a
parent04fa88c66ab876842d1e8d3b7ffedfec1408eef8 (diff)
downloadchrome-ec-stabilize-14092.57.B-main.tar.gz
flash_fp_mcu: Fix interrupt to unbind race caused by pwr_enstabilize-14092.66.B-mainstabilize-14092.57.B-mainrelease-R93-14092.B-main
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> (cherry picked from commit 6e4ed0664ef649b0170894cc2ac1a738d3673ce1) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3041185 Commit-Queue: Jora Jacobi <jora@google.com> Reviewed-by: Jora Jacobi <jora@google.com>
-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