MLK-9986-5 spi: spi-imx: decrease tx fifo wartermark level
authorRobin Gong <b38343@freescale.com>
Thu, 18 Dec 2014 04:51:28 +0000 (12:51 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:25 +0000 (14:47 -0500)
commita6b41fdae13c3ecf2df674e8d39897790dfe7e98
tree2fd38211d94311d964813a47a8f8d4f2128978c1
parentfb2a29792bfc8121a48e8b0d3afb42b658dd82d0
MLK-9986-5 spi: spi-imx: decrease tx fifo wartermark level

We set both wartermark of txfifo and rxfifo 32 as half of fifo length 64.
That will cause easy rxfifo overflow:
If there is 31 bytes in rxfifo, rx script will wait the next dma request
(the 32th data come into the rxfifo) and schedule out to tx script. Once
tx script start to run, the rx script need to wait tx script finish even
if its priority higher than tx. Meanwhile, spi slave device may input
data continous, plus the rx data which triggered by new tx script(32 bytes).
That will quickly consume whole 64 bytes fifo, so we keep 16bytes availbale
even in the worst case new tx script triggered during two rx transfer. That
may slow down tx slightly, but better than overflow and RX DMA timeout.

Signed-off-by: Robin Gong <b38343@freescale.com>
(cherry picked from commit 16043ad0ad96aa04a90614e473aa17980af4b8af)
(cherry picked from commit 819efee83b7b1f47685dca6fad6bbe17f1c42092)
(cherry picked from commit 5c4c7d05bbba0ea2b26ef2f3ae83119d5eada235)
drivers/spi/spi-imx.c