From ec3013fda6d2143ab5ebf1ed022a33a400bbb656 Mon Sep 17 00:00:00 2001 From: rav4kumar <36933347+rav4kumar@users.noreply.github.com> Date: Mon, 17 Aug 2026 19:04:58 -0700 Subject: [PATCH] Revert "pandad: guarantee SPI slave turnaround time (#38464)" This reverts commit aa0ac919baa0df2fa792e281246d4a1a1e6a1652. --- openpilot/selfdrive/pandad/spi.cc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/openpilot/selfdrive/pandad/spi.cc b/openpilot/selfdrive/pandad/spi.cc index 369032a533..f54c26e506 100644 --- a/openpilot/selfdrive/pandad/spi.cc +++ b/openpilot/selfdrive/pandad/spi.cc @@ -29,12 +29,6 @@ enum SpiError { const unsigned int SPI_ACK_TIMEOUT = 500; // milliseconds const std::string SPI_DEVICE = "/dev/spidev0.0"; -// TODO: fix SPI turnaround synchronization at the protocol level. -static uint64_t spi_last_bus_activity_ns = 0; // protected by hw_lock - -static void wait_for_spi_turnaround(uint64_t start_ns) { - while ((nanos_since_boot() - start_ns) < 400000) {} -} class LockEx { public: @@ -325,8 +319,6 @@ int PandaSpiHandle::spi_transfer(uint8_t endpoint, uint8_t *tx_data, uint16_t tx assert(tx_len < SPI_BUF_SIZE); assert(max_rx_len < SPI_BUF_SIZE); - wait_for_spi_turnaround(spi_last_bus_activity_ns); - xfer_count++; header = { .sync = SPI_SYNC, @@ -355,7 +347,6 @@ int PandaSpiHandle::spi_transfer(uint8_t endpoint, uint8_t *tx_data, uint16_t tx if (ret < 0) { goto fail; } - wait_for_spi_turnaround(nanos_since_boot()); // Send data if (tx_data != NULL) { @@ -398,7 +389,6 @@ int PandaSpiHandle::spi_transfer(uint8_t endpoint, uint8_t *tx_data, uint16_t tx memcpy(rx_data, rx_buf + 3, rx_data_len); } - spi_last_bus_activity_ns = nanos_since_boot(); return rx_data_len; fail: @@ -413,7 +403,6 @@ fail: } } - spi_last_bus_activity_ns = nanos_since_boot(); if (ret >= 0) ret = -1; return ret; }