]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2026 15:35:33 +0000 (16:35 +0100)
commit69695f5331d4d670eff76376faa3aeb5d68733e3
tree39eae7c89873d0f658aaf6097c51ec1740bcc997
parent81531bdea972c3cd8f147f61ca6027fa24e08fc3
spi: cadence-quadspi: Prevent lost complete() call during indirect read

[ Upstream commit d67396c9d697041b385d70ff2fd59cb07ae167e8 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-cadence-quadspi.c