Skip to content

Commit cac7e50

Browse files
Larisa Grigorebroonie
authored andcommitted
spi: spi-fsl-dspi: Avoid setup_accel logic for DMA transfers
Repacking multiple smaller words into larger ones to make use of the full FIFO doesn't save anything in DMA mode, so don't bother doing it. Signed-off-by: Larisa Grigore <larisa.grigore@nxp.com> Signed-off-by: James Clark <james.clark@linaro.org> Link: https://patch.msgid.link/20250522-james-nxp-spi-v2-8-bea884630cfb@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e7397e4 commit cac7e50

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

drivers/spi/spi-fsl-dspi.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,12 @@ static void dspi_setup_accel(struct fsl_dspi *dspi)
850850
struct spi_transfer *xfer = dspi->cur_transfer;
851851
bool odd = !!(dspi->len & 1);
852852

853-
/* No accel for frames not multiple of 8 bits at the moment */
854-
if (xfer->bits_per_word % 8)
853+
/*
854+
* No accel for DMA transfers or frames not multiples of 8 bits at the
855+
* moment.
856+
*/
857+
if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE ||
858+
xfer->bits_per_word % 8)
855859
goto no_accel;
856860

857861
if (!odd && dspi->len <= dspi->devtype_data->fifo_size * 2) {
@@ -860,10 +864,7 @@ static void dspi_setup_accel(struct fsl_dspi *dspi)
860864
dspi->oper_bits_per_word = 8;
861865
} else {
862866
/* Start off with maximum supported by hardware */
863-
if (dspi->devtype_data->trans_mode == DSPI_XSPI_MODE)
864-
dspi->oper_bits_per_word = 32;
865-
else
866-
dspi->oper_bits_per_word = 16;
867+
dspi->oper_bits_per_word = 32;
867868

868869
/*
869870
* And go down only if the buffer can't be sent with

0 commit comments

Comments
 (0)