]> git.baikalelectronics.ru Git - kernel.git/commit
spi: dw: Use DMA max burst to set the request thresholds
authorBaikal Electronics <support@baikalelectronics.ru>
Fri, 29 May 2020 13:11:56 +0000 (16:11 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 29 May 2020 14:55:47 +0000 (15:55 +0100)
commitc17c358de94e083bf054c01fb2ee5633a851d8b6
tree916c62be23713b8c2def4ac74f755f9a13727f80
parent2d9daa5846c4ccfa6880a6202c062db520f95e40
spi: dw: Use DMA max burst to set the request thresholds

Each channel of DMA controller may have a limited length of burst
transaction (number of IO operations performed at ones in a single
DMA client request). This parameter can be used to setup the most
optimal DMA Tx/Rx data level values. In order to avoid the Tx buffer
overrun we can set the DMA Tx level to be of FIFO depth minus the
maximum burst transactions length. To prevent the Rx buffer underflow
the DMA Rx level should be set to the maximum burst transactions length.
This commit setups the DMA channels and the DW SPI DMA Tx/Rx levels
in accordance with these rules.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Arnd Bergmann <arnd@arndb.de>
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-8-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-dw-mid.c
drivers/spi/spi-dw.h