]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/spi/spi-atmel.c
spi: atmel: Fix interrupt setup for PDC transfers
authorTorsten Fleischer <torfl6749@gmail.com>
Tue, 24 Feb 2015 15:32:57 +0000 (16:32 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 26 Feb 2015 02:34:23 +0000 (11:34 +0900)
commit76e1d14b316d6f501ebc001e7a5d86b24ce5b615
tree91109cbe1ae78acf1847e03aab321d9d7b4df67f
parentc517d838eb7d07bbe9507871fab3931deccff539
spi: atmel: Fix interrupt setup for PDC transfers

Additionally to the current DMA transfer the PDC allows to set up a next DMA
transfer. This is useful for larger SPI transfers.

The driver currently waits for ENDRX as end of the transfer. But ENDRX is set
when the current DMA transfer is done (RCR = 0), i.e. it doesn't include the
next DMA transfer.
Thus a subsequent SPI transfer could be started although there is currently a
transfer in progress. This can cause invalid accesses to the SPI slave devices
and to SPI transfer errors.

This issue has been observed on a hardware with a M25P128 SPI NOR flash.

So instead of ENDRX we should wait for RXBUFF. This flag is set if there is
no more DMA transfer in progress (RCR = RNCR = 0).

Signed-off-by: Torsten Fleischer <torfl6749@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
drivers/spi/spi-atmel.c