]> git.ipfire.org Git - thirdparty/linux.git/commit
spi: cadence-quadspi: Fix indirect write timeout when DMA read mode is enabled
authorSrikanth Boyapally <srikanth.boyapally@amd.com>
Wed, 8 Jul 2026 04:51:48 +0000 (10:21 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 14 Jul 2026 11:54:50 +0000 (12:54 +0100)
commite919ca35a6e84b5adf085da9ffa1544c01d4ce1e
treed2453c4716a80d636a24856da5c20ca32247a9e0
parent0bcd59706aeda8a5d48ba656bab74cb26f2b423e
spi: cadence-quadspi: Fix indirect write timeout when DMA read mode is enabled

When use_dma_read is enabled, the IRQ handler unconditionally overwrites
irq_status with the return value of get_dma_status(). For write operations,
DMA status returns 0 since no DMA read is in progress, causing irq_status
to become 0. The subsequent completion signal is never triggered and the
write operation times out with -ETIMEDOUT:

  cadence-qspi f1010000.spi: Indirect write timeout
  spi-nor spi0.1: operation failed with -110

Fix this by separating the DMA completion path from the write interrupt
path. If get_dma_status() indicates DMA read completion, signal completion
and return immediately. Otherwise, preserve the original irq_status so that
write completion interrupts are correctly recognized and signalled.

Fixes: aac733a96636 ("spi: cadence-qspi: Fix style and improve readability")
Signed-off-by: Srikanth Boyapally <srikanth.boyapally@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Link: https://patch.msgid.link/20260708045148.2993313-1-srikanth.boyapally@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c