From: Ben Nizette Date: Tue, 15 Dec 2009 06:20:20 +0000 (-0800) Subject: atmel_spi: fix dma addr calculation for len > BUFFER_SIZE X-Git-Tag: v2.6.33-rc1~9^2~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6aed4ee9b4610cd1e0315c90855b32e59ee81a15;p=pandora-kernel.git atmel_spi: fix dma addr calculation for len > BUFFER_SIZE If len > BUFFER_LEN and !xfer->rx_buf we end up calculating the tx buffer address as *tx_dma = xfer->tx_dma + xfer->len - BUFFER_SIZE; which is constant; i.e. we just send the last BUFFER_SIZE data over again until we've reached the right number of bytes. This patch gets around this by using the /requested/ length when calculating addresses. Note there's no way len != *plen when we calculate the rx buffer address but conceptually we should be using *plen and I don't want someone to come through later, see the calculations for rx and tx are different and "clean up" back to what we had. Signed-off-by: Ben Nizette Cc: Haavard Skinnemoen Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Grant Likely --- Reading git-diff-tree failed