spi: spi-fsl-dspi: Implement .max_message_size method for EOQ mode
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 4 Mar 2020 22:00:38 +0000 (00:00 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 5 Mar 2020 14:06:18 +0000 (14:06 +0000)
commita3185c38dc6cd664b2b576eb9d3e5d2f49101a10
tree5195208b6f8903cc69da314dff8e7b82428bc7fa
parent547248fbed23f3cd2f6a5937b44fad60993640c4
spi: spi-fsl-dspi: Implement .max_message_size method for EOQ mode

When it gets set, End Of Queue Flag halts the DSPI controller and forces
the chip select signal to deassert.

This operating mode is not ideal, but it is used for the DSPI
instantiations where there is no other notification from the controller
that the data in the FIFO has finished transmission. So in practice, it
means that transmitting buffers larger than the FIFO size will yield
unpredictable results.

The only controller that operates in EOQ mode is MCF5441X (Coldfire). I
would say that the way EOQ is used (and documented in the reference
manual, too) on this chip is incorrect, and I would personally migrate
it to TCFQ, but that's notably worse in terms of performance (it can
only use 1 entry of the 16-deep FIFO) and if this limitation didn't
bother any Coldfire DSPI user so far, it's likely that we just need to
throw an error for larger buffers to make sure that callers are aware
their transfers are getting truncated/split.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20200304220044.11193-7-olteanv@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c