summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshwini Ghuge <aghuge@nvidia.com>2012-06-20 14:14:28 +0530
committerSimone Willett <swillett@nvidia.com>2012-06-20 13:47:44 -0700
commit4c165a4d5e76e5c111ac21c9d9506ea6d87705c9 (patch)
tree499c4cab544bf7e5a9aa2b2181d1eb709695107c
parentb426ea53fbdd902e85eacb865d1b2912b49260fe (diff)
spi: tegra: Max tx words limited to max buff size
When computing required words for a transfer, limit this to max possible size on given sub transfer Change-Id: Ia1a9290ae389e36ecb5a8d03be2982885a544a33 Signed-off-by: Ashwini Ghuge <aghuge@nvidia.com> Reviewed-on: http://git-master/r/109462 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
-rw-r--r--drivers/spi/spi-tegra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c
index 33e2004101b7..0af220c863c2 100644
--- a/drivers/spi/spi-tegra.c
+++ b/drivers/spi/spi-tegra.c
@@ -346,12 +346,12 @@ 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 = remain_len/4;
+ total_fifo_words = max_len/4;
} else {
max_word = (remain_len - 1) / tspi->bytes_per_word + 1;
max_word = min(max_word, tspi->max_buf_size/4);
tspi->curr_dma_words = max_word;
- total_fifo_words = remain_len/tspi->bytes_per_word;
+ total_fifo_words = max_word;
}
return total_fifo_words;
}