OSDN Git Service

spi: lpspi: fix dataloss when SS is inactivated between every words
authorClark Wang <xiaoning.wang@nxp.com>
Thu, 21 Mar 2019 09:57:12 +0000 (09:57 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 21 Mar 2019 15:02:28 +0000 (15:02 +0000)
commit69c8a9bcb03222ad3b949064ac05de463c7c9aa3
tree2d2fc0763f1d4882342cf4769c21e92b060683c9
parentf37d8e67f39e6d3eaf4cc5471e8a3d21209843c6
spi: lpspi: fix dataloss when SS is inactivated between every words

If we don't use CONT to keep SS activated or use DMA mode without
cs-gpio, SS will be inactivated between every words. The word here
means the data sent once which length can be set as 1/2/4 bytes.

In the isr function, we read the FSR_RXCOUNT just behind the
fsl_lpspi_read_rx_fifo. This causes the value of FSR_RXCOUNT cannot
reflect whether there is still data not sent timely. So do this
judgement by FSR_TXCOUNT.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-lpspi.c