When testing SPI without DMA I noticed that filling the FIFO on the
spi controller causes timeout. This should never happen with DMA support
so just adding a comment.

Signed-off-by: Michal Suchanek <[email protected]>
---
 drivers/spi/spi-sun4i.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index d98f560..3479252 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -333,7 +333,9 @@ static int sun4i_spi_transfer_one(struct spi_master *master,
                sun4i_spi_write(sspi, SUN4I_DMA_CTL_REG, 0);
 
                /* Fill the TX FIFO */
-               sun4i_spi_fill_fifo(sspi, SUN4I_FIFO_DEPTH);
+               /* Filling the fifo fully causes timeout for some reason - at 
least on spi2 on a10s */
+               /* The can_dma check is txlen >= SUN4I_FIFO_DEPTH so with DMA 
this should never happen anyway. */
+               sun4i_spi_fill_fifo(sspi, SUN4I_FIFO_DEPTH - 1);
        }
 
        /* Start the transfer */
-- 
2.1.4

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to