spi: spi-fsl-dspi: Fix bits-per-word acceleration in DMA mode
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 18 Mar 2020 00:15:54 +0000 (02:15 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 18 Mar 2020 22:44:55 +0000 (22:44 +0000)
commita957499bd437720d082d92657b7eb5cf5a62e893
treedeefe2920fe3f2ec7aba09db2437c6adb7ef80a4
parent671ffde1752f594c60ccdfd75378defacfaf7c83
spi: spi-fsl-dspi: Fix bits-per-word acceleration in DMA mode

In DMA mode, dspi_setup_accel does not get called, which results in the
dspi->oper_word_size variable (which is used by dspi_dma_xfer) to not be
initialized properly.

Because oper_word_size is zero, a few calculations end up being
incorrect, and the DMA transfer eventually times out instead of sending
anything on the wire.

Set up native transfers (or 8-on-16 acceleration) using dspi_setup_accel
for DMA mode too.

Also take the opportunity and simplify the DMA buffer handling a little
bit.

Fixes: 6c1c26ecd9a3 ("spi: spi-fsl-dspi: Accelerate transfers using larger word size if possible")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20200318001603.9650-4-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c