]> git.ipfire.org Git - thirdparty/linux.git/commit
spi: spacemit: prepare both DMA descriptors before submitting
authorSurendra Singh Chouhan <kr494167@gmail.com>
Wed, 22 Jul 2026 16:24:44 +0000 (21:54 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 22 Jul 2026 21:05:55 +0000 (22:05 +0100)
commitd3c87e71539cb183ea6173a99dc0e6f84fa0bc4f
treeca0500e100dcd69ba4f1680058290de0940d0203
parent6389eaf11d6cd3a66d10d0a5ea9cd91f242ccba2
spi: spacemit: prepare both DMA descriptors before submitting

k1_spi_dma_one() currently submits the TX DMA descriptor to the DMA engine
before preparing the RX DMA descriptor. If preparing the RX descriptor
subsequently fails, the function jumps to the fallback error path without
canceling or aborting the already submitted TX DMA descriptor.

Fix this by preparing both the TX and RX descriptors before submitting
either of them to the DMA engine.

Fixes: efcd8b9d1111 ("spi: spacemit: introduce SpacemiT K1 SPI controller driver")
Reviewed-by: Alex Elder <elder@riscstar.com>
Signed-off-by: Surendra Singh Chouhan <kr494167@gmail.com>
Link: https://patch.msgid.link/20260722162444.11415-1-kr494167@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-spacemit-k1.c