Re: [PATCH 03/13] spi: spi-fsl-lpspi: Reset FIFO and disable module on transfer abort
From: James Clark
Date: Mon Aug 18 2025 - 09:32:31 EST
On 14/08/2025 5:51 pm, Frank Li wrote:
On Thu, Aug 14, 2025 at 05:06:43PM +0100, James Clark wrote:
From: Larisa Grigore <larisa.grigore@xxxxxxx>
In DMA mode fsl_lpspi_reset() is always called at the end, even when the
transfer is aborted. When not using DMA, aborts skip the reset leaving
Nit: s/"When not using DMA"/In PIO mode
Ack
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
the FIFO filled and the module enabled.
Fix it by always calling fsl_lpspi_reset().
Fixes: a15dc3d657fa ("spi: lpspi: Fix CLK pin becomes low before one transfer")
Signed-off-by: Larisa Grigore <larisa.grigore@xxxxxxx>
Signed-off-by: James Clark <james.clark@xxxxxxxxxx>
---
drivers/spi/spi-fsl-lpspi.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c
index c65eb6d31ee7..aab92ee7eb94 100644
--- a/drivers/spi/spi-fsl-lpspi.c
+++ b/drivers/spi/spi-fsl-lpspi.c
@@ -734,12 +734,10 @@ static int fsl_lpspi_pio_transfer(struct spi_controller *controller,
fsl_lpspi_write_tx_fifo(fsl_lpspi);
ret = fsl_lpspi_wait_for_completion(controller);
- if (ret)
- return ret;
fsl_lpspi_reset(fsl_lpspi);
- return 0;
+ return ret;
}
static int fsl_lpspi_transfer_one(struct spi_controller *controller,
--
2.34.1