Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: tegra210-quad: Fix false positive WARN on interrupt timeout with transfer complete

The WARN_ON_ONCE/WARN_ON fired unconditionally on any completion
timeout, including the recoverable case where the interrupt was lost but
the hardware actually finished the transfer. This produced a noisy splat
with a full call trace even though the driver successfully recovered via
tegra_qspi_handle_timeout().

Since tegra210 uses threaded interrupts, the transfer completion can be
signaled before the interrupt fires, making this false positive case
common in practice.

Almost all the hosts I sysadmin in my fleet produce the following splat:

WARNING: CPU: 47 PID: 844 at drivers/spi/spi-tegra210-quad.c:1226 tegra_qspi_transfer_one_message+0x8a4/0xba8
....
tegra-qspi NVDA1513:00: QSPI interrupt timeout, but transfer complete

Move WARN_ON_ONCE/WARN_ON to fire only on real unrecoverable timeouts,
i.e., when tegra_qspi_handle_timeout() confirms the hardware did NOT
complete. This makes the warning actionable instead of just polluting
the metrics.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260408-tegra_warn-v1-1-669a3bc74d77@debian.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Breno Leitao and committed by
Mark Brown
5b94c94c 6dd13023

+4 -2
+4 -2
drivers/spi/spi-tegra210-quad.c
··· 1223 1223 (&tqspi->xfer_completion, 1224 1224 QSPI_DMA_TIMEOUT); 1225 1225 1226 - if (WARN_ON_ONCE(ret == 0)) { 1226 + if (ret == 0) { 1227 1227 /* 1228 1228 * Check if hardware completed the transfer 1229 1229 * even though interrupt was lost or delayed. ··· 1232 1232 ret = tegra_qspi_handle_timeout(tqspi); 1233 1233 if (ret < 0) { 1234 1234 /* Real timeout - clean up and fail */ 1235 + WARN_ON_ONCE(1); 1235 1236 dev_err(tqspi->dev, "transfer timeout\n"); 1236 1237 1237 1238 /* Abort transfer by resetting pio/dma bit */ ··· 1341 1340 1342 1341 ret = wait_for_completion_timeout(&tqspi->xfer_completion, 1343 1342 QSPI_DMA_TIMEOUT); 1344 - if (WARN_ON(ret == 0)) { 1343 + if (ret == 0) { 1345 1344 /* 1346 1345 * Check if hardware completed the transfer even though 1347 1346 * interrupt was lost or delayed. If so, process the ··· 1350 1349 ret = tegra_qspi_handle_timeout(tqspi); 1351 1350 if (ret < 0) { 1352 1351 /* Real timeout - clean up and fail */ 1352 + WARN_ON(1); 1353 1353 dev_err(tqspi->dev, "transfer timeout\n"); 1354 1354 1355 1355 if (tqspi->is_curr_dma_xfer)