Skip to content

Commit 5b94c94

Browse files
leitaobroonie
authored andcommitted
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>
1 parent 6dd1302 commit 5b94c94

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/spi/spi-tegra210-quad.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
12231223
(&tqspi->xfer_completion,
12241224
QSPI_DMA_TIMEOUT);
12251225

1226-
if (WARN_ON_ONCE(ret == 0)) {
1226+
if (ret == 0) {
12271227
/*
12281228
* Check if hardware completed the transfer
12291229
* even though interrupt was lost or delayed.
@@ -1232,6 +1232,7 @@ static int tegra_qspi_combined_seq_xfer(struct tegra_qspi *tqspi,
12321232
ret = tegra_qspi_handle_timeout(tqspi);
12331233
if (ret < 0) {
12341234
/* Real timeout - clean up and fail */
1235+
WARN_ON_ONCE(1);
12351236
dev_err(tqspi->dev, "transfer timeout\n");
12361237

12371238
/* Abort transfer by resetting pio/dma bit */
@@ -1340,7 +1341,7 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi,
13401341

13411342
ret = wait_for_completion_timeout(&tqspi->xfer_completion,
13421343
QSPI_DMA_TIMEOUT);
1343-
if (WARN_ON(ret == 0)) {
1344+
if (ret == 0) {
13441345
/*
13451346
* Check if hardware completed the transfer even though
13461347
* interrupt was lost or delayed. If so, process the
@@ -1349,6 +1350,7 @@ static int tegra_qspi_non_combined_seq_xfer(struct tegra_qspi *tqspi,
13491350
ret = tegra_qspi_handle_timeout(tqspi);
13501351
if (ret < 0) {
13511352
/* Real timeout - clean up and fail */
1353+
WARN_ON(1);
13521354
dev_err(tqspi->dev, "transfer timeout\n");
13531355

13541356
if (tqspi->is_curr_dma_xfer)

0 commit comments

Comments
 (0)