]> git.baikalelectronics.ru Git - 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)
commitee3dea4d382c5a8cf0e3a8572fcb148981f32137
tree354413e8bf60d547b45eadc280bb93fbb1ace01e
parent0b76f77a37f2a348bd8b741d28d7510a3d9f5598
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