]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: cadence-quadspi: Prevent lost complete() call during indirect read
authorMateusz Litwin <mateusz.litwin@nokia.com>
Thu, 18 Dec 2025 21:33:04 +0000 (22:33 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 23 Dec 2025 10:58:57 +0000 (10:58 +0000)
commitd67396c9d697041b385d70ff2fd59cb07ae167e8
tree34cab41b6c99d58b8774143874ba7b6bf1eb9f0c
parent9448598b22c50c8a5bb77a9103e2d49f134c9578
spi: cadence-quadspi: Prevent lost complete() call during indirect read

A race condition exists between the read loop and IRQ `complete()` call.
An interrupt could call the complete() between the inner loop and
reinit_completion(), potentially losing the completion event and causing
an unnecessary timeout. Moving reinit_completion() before the loop
prevents this. A premature signal will only result in a spurious wakeup
and another wait cycle, which is preferable to waiting for a timeout.

Signed-off-by: Mateusz Litwin <mateusz.litwin@nokia.com>
Link: https://patch.msgid.link/20251218-cqspi_indirect_read_improve-v2-1-396079972f2a@nokia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c