From 6067e90bd06d55edbd3b1417369dda53ca11c0f0 Mon Sep 17 00:00:00 2001 From: Murat Khairulin Date: Tue, 5 May 2015 19:43:19 +0300 Subject: spi:tegra: fix number of words in transfer Calculate the number of words in a transfer properly: if there are 129-131 bytes, then number of words is more than 32, therefore the transfer should be handled with DMA rather than FIFO. --- drivers/spi/spi-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c index 5fca5e62706c..2fd2fd68edfe 100644 --- a/drivers/spi/spi-tegra.c +++ b/drivers/spi/spi-tegra.c @@ -381,7 +381,7 @@ static unsigned spi_tegra_calculate_curr_xfer_param( if (tspi->is_packed) { max_len = min(remain_len, tspi->max_buf_size); tspi->curr_dma_words = max_len/tspi->bytes_per_word; - total_fifo_words = max_len/4; + total_fifo_words = (max_len + 3)/4; } else { max_word = (remain_len - 1) / tspi->bytes_per_word + 1; max_word = min(max_word, tspi->max_buf_size/4); -- cgit v1.2.3