OSDN Git Service

spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 22 Mar 2017 00:18:26 +0000 (09:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 22 Mar 2018 08:23:22 +0000 (09:23 +0100)
commitd074ae9505e4f9f811e4df37ec7136f2900ca1ae
treee39b7d0919944c392f427e276ad6cbf2835c4ae8
parentffe11f9f642fad25a4443c08b8d7a345f46404ce
spi: omap2-mcspi: poll OMAP2_MCSPI_CHSTAT_RXS for PIO transfer

[ Upstream commit 812613591cb652344186c4cd912304ed02138566 ]

When running the spi-loopback-test with slower clock rate like 10 KHz,
the test for 251 bytes transfer was failed.  This failure triggered an
spi-omap2-mcspi's error message "DMA RX last word empty".

This message means that PIO for reading the remaining bytes due to the
DMA transfer length reduction is failed.  This problem can be fixed by
polling OMAP2_MCSPI_CHSTAT_RXS bit in channel status register to wait
until the receive buffer register is filled.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-omap2-mcspi.c