]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: imx: avoid dmaengine_terminate_all() on TX prep failure
authorCarlos Song <carlos.song@nxp.com>
Wed, 3 Dec 2025 08:59:46 +0000 (16:59 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 14 Dec 2025 10:38:49 +0000 (19:38 +0900)
If dmaengine_prep_slave_sg() fails, no descriptor is submitted to the TX
channel and DMA is never started. Therefore, calling
dmaengine_terminate_all() for the TX DMA channel is unnecessary.

Signed-off-by: Carlos Song <carlos.song@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251203085949.2922166-4-carlos.song@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-imx.c

index 012f5bcbf73f46924abf6f0630f8634f38463de8..186963d3d2e0c23f28b98d60ff2dbadf8b845d6f 100644 (file)
@@ -1468,7 +1468,6 @@ static int spi_imx_dma_submit(struct spi_imx_data *spi_imx,
                                          tx->sgl, tx->nents, DMA_MEM_TO_DEV,
                                          DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc_tx) {
-               dmaengine_terminate_all(controller->dma_tx);
                dmaengine_terminate_all(controller->dma_rx);
                return -EINVAL;
        }