From mboxrd@z Thu Jan 1 00:00:00 1970 From: Priit Laes Subject: [PATCH 2/2] ARM: sunxi: spi: add notice about SPI FIFO limit. Date: Fri, 26 Feb 2016 07:56:57 +0200 Message-ID: <1456466217-6793-3-git-send-email-plaes@plaes.org> References: <1456466217-6793-1-git-send-email-plaes@plaes.org> Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, =?UTF-8?q?Emilio=20L=C3=B3pez?= , Michal Suchanek To: Mark Brown , Maxime Ripard , Chen-Yu Tsai Return-path: In-Reply-To: <1456466217-6793-1-git-send-email-plaes-q/aMd4JkU83YtjvyW6yDsg@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: From: Michal Suchanek 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 --- 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 78141a6..b750664 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.7.2 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html