Skip to content

spi: tegra210-quad: Improve timeout handling under high system load

Vishwaroop A linux-spi linux-tegra lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 5 repliesIn review
  2. v43 patches 0 repliesSuperseded
  3. v33 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches2 repliesSuperseded
v12 patches1 replySuperseded

Changes in v5 from the cover letter

- No code changes, rebased to resolve conflicts

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3spi: tegra210-quad: Fix timeout handlingdrivers/spi/spi-tegra210-quad.c+20 -21 reply
2/3spi: tegra210-quad: Refactor error handling into helper functionsdrivers/spi/spi-tegra210-quad.c+44 -401 reply
3/3spi: tegra210-quad: Check hardware status on timeoutdrivers/spi/spi-tegra210-quad.c+80 -201 reply

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchThierry RedingJon Hunter
SeriesT-b R-b
1/3
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/3] spi: tegra210-quad: Improve timeout handling under high system load

Hi,

This patch series addresses timeout handling issues in the Tegra QSPI driver that occur under high system load conditions. We've observed that when CPUs are saturated (due to error injection, RAS firmware activity, or general CPU contention), QSPI interrupt handlers can be delayed, causing spurious transfer failures even though the hardware completed the operation successfully.

Patch 1 fixes a stale pointer issue by ensuring curr_xfer is cleared on timeout and checked when the IRQ thread finally runs. It also ensures interrupts are properly cleared on failure paths.

Patch 2 refactors the timeout cleanup code into dedicated helper functions (tegra_qspi_reset, tegra_qspi_dma_stop, tegra_qspi_pio_stop) to improve code readability and maintainability. This is purely a code reorganization with no functional changes.

Patch 3 adds hardware status checking on timeout. Before failing a transfer, the driver now reads QSPI_TRANS_STATUS to verify if the hardware actually completed the operation. If so, it manually invokes the completion handler instead of failing the transfer. This distinguishes genuine hardware timeouts from delayed/lost interrupts.

These changes have been tested in production environments under various high load scenarios including RAS testing and CPU saturation workloads.

Changes in v5:
- No code changes, rebased to resolve conflicts

Changes in v4:
- Removed Change-Id from commit messages

Changes in v3:
- Added missing tqspi->curr_xfer = NULL assignment in handle_cpu_based_xfer()
- Split the previous patch 2/2 into two separate patches (now 2/3 and 3/3)
- Patch 2/3: New patch - refactoring only, no functional changes
- Patch 3/3: Functional changes to add hardware timeout checking

Changes in v2:
- Fixed indentation in patch 1/2: The "Reset controller if timeout happens" block now has correct indentation (inside the WARN_ON_ONCE block)
- No functional changes

Thierry Reding (1):
spi: tegra210-quad: Fix timeout handling

Vishwaroop A (2):
spi: tegra210-quad: Refactor error handling into helper functions
spi: tegra210-quad: Check hardware status on timeout

 drivers/spi/spi-tegra210-quad.c | 174 +++++++++++++++++++++++---------
 1 file changed, 128 insertions(+), 46 deletions(-)
Signature · 1 line
2.17.1