]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
spi: stm32: enhance DMA error management
authorAmelie Delaunay <amelie.delaunay@st.com>
Tue, 27 Jun 2017 15:45:19 +0000 (17:45 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 28 Jun 2017 19:00:54 +0000 (20:00 +0100)
commitc67ad368cf75d4999d5ef86543d082b4b35dd2d7
tree354413e8bf60d547b45eadc280bb93fbb1ace01e
parent038ac869c9d27fceb6197e775d780ad6aeb45b1f
spi: stm32: enhance DMA error management

This patch reworks DMA error management. In case the DMA callback is
called while EOT (End Of Transfer) flag is not set, that means that DMA
encountered an error. This error will result in an auto-suspend of SPI
flow, which could also result in an overrun. So, in DMA mode, SUSP and
OVR flags are a condition to stop the current transfer.

Moreover, stm32_spi_can_dma doesn't care about the state of dma channels.
During driver probe, master->can_dma is initialised if dma channel request
is successful. That's why we must use master->can_dma to know if dma
use is possible (dma channel are successfully requested and the transfer
size is greater than fifo size).

Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32.c