]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: Add SPI Tx-done wait method to DMA-based transfer
authorBaikal Electronics <support@baikalelectronics.ru>
Fri, 29 May 2020 13:11:53 +0000 (16:11 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 29 May 2020 14:55:44 +0000 (15:55 +0100)
commit95f01954deceb600ec950bae4178a918856db9a6
tree7cbc45067073bbdedd1435ee86383c50f22a9808
parent38f8e630548bc3c79f9743ae4c95c16bf7448d50
spi: dw: Add SPI Tx-done wait method to DMA-based transfer

Since DMA transfers are performed asynchronously with actual SPI bus
transfers, then even if DMA transactions are finished it doesn't mean
all data is actually pushed to the SPI bus. Some data might still be
in the controller FIFO. This is specifically true for Tx-only transfers.
In this case if the next SPI transfer is recharged while a tail of the
previous one is still in FIFO, we'll loose that tail data. In order to
fix that problem let's add the wait procedure of the Tx SPI transfer
completion after the DMA transactions are finished.

Fixes: dd6414877853 ("spi/dw_spi: add DMA support")
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru>
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru>
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-5-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-mid.c