]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
atmel_spi dma address bugfix
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 1 Jun 2007 07:47:00 +0000 (00:47 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 1 Jun 2007 15:18:29 +0000 (08:18 -0700)
commit5a9a62bb035b1f74e7d017e3bd48d1c687d7de3c
tree0f4d5474d750ade240f399c0dc8335debfc15c02
parente88b34bade55a51dd23a50de0ac5076cbbb8f4fd
atmel_spi dma address bugfix

When either rx_buf or tx_buf is not being used, i.e.  for plain read- or
write operations, the atmel_spi uses a fixed-size DMA buffer instead.  If
the transfer is longer than the size of this buffer, it is split into
multiple DMA transfers.

When the transfer is split like this, the atmel_spi driver ends up using
the same DMA address again and again even for the buffer that came from the
user, which is of course wrong.  Fix this by adding the number of bytes
already transferred to the DMA address so that the data ends up in the
right place.

Thanks to Wu Xuan for discovering this bug.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/atmel_spi.c