Re: [PATCH 5/6] spi: imx: support dynamic burst length for ECSPI DMA mode
From: Marc Kleine-Budde
Date: Wed Nov 26 2025 - 07:23:04 EST
On 25.11.2025 18:06:17, Carlos Song wrote:
> static int spi_imx_pio_transfer(struct spi_device *spi,
> struct spi_transfer *transfer)
> {
> @@ -1780,9 +2112,14 @@ static int spi_imx_transfer_one(struct spi_controller *controller,
> * transfer, the SPI transfer has already been mapped, so we
> * have to do the DMA transfer here.
> */
> - if (spi_imx->usedma)
> - return spi_imx_dma_transfer(spi_imx, transfer);
> -
> + if (spi_imx->usedma) {
> + ret = spi_imx_dma_transfer(spi_imx, transfer);
> + if (transfer->error & SPI_TRANS_FAIL_NO_START) {
> + spi_imx->usedma = false;
> + return spi_imx_pio_transfer(spi, transfer);
> + }
> + return ret;
> + }
Why do you do this? AFAICS the framework already does this for you see:
spi_transfer_one_message().
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature