• Geert Uytterhoeven's avatar
    spi: rspi: Fix interrupted DMA transfers · b6adc1f2
    Geert Uytterhoeven authored
    commit 8dbbaa47b96f6ea5f09f922b4effff3c505cd8cf upstream.
    
    When interrupted, wait_event_interruptible_timeout() returns
    -ERESTARTSYS, and the SPI transfer in progress will fail, as expected:
    
        m25p80 spi0.0: SPI transfer failed: -512
        spi_master spi0: failed to transfer one message from queue
    
    However, as the underlying DMA transfers may not have completed, all
    subsequent SPI transfers may start to fail:
    
        spi_master spi0: receive timeout
        qspi_transfer_out_in() returned -110
        m25p80 spi0.0: SPI transfer failed: -110
        spi_master spi0: failed to transfer one message from queue
    
    Fix this by calling dmaengine_terminate_all() not only for timeouts, but
    also for errors.
    
    This can be reproduced on r8a7991/koelsch, using "hd /dev/mtd0" followed
    by CTRL-C.
    Signed-off-by: 's avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: 's avatarMark Brown <broonie@kernel.org>
    Cc: stable@vger.kernel.org
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    b6adc1f2
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
spi-adi-v3.c Loading commit data...
spi-altera.c Loading commit data...
spi-armada-3700.c Loading commit data...
spi-ath79.c Loading commit data...
spi-atmel.c Loading commit data...
spi-au1550.c Loading commit data...
spi-axi-spi-engine.c Loading commit data...
spi-bcm-qspi.c Loading commit data...
spi-bcm-qspi.h Loading commit data...
spi-bcm2835.c Loading commit data...
spi-bcm2835aux.c Loading commit data...
spi-bcm53xx.c Loading commit data...
spi-bcm53xx.h Loading commit data...
spi-bcm63xx-hsspi.c Loading commit data...
spi-bcm63xx.c Loading commit data...
spi-bfin-sport.c Loading commit data...
spi-bfin5xx.c Loading commit data...
spi-bitbang-txrx.h Loading commit data...
spi-bitbang.c Loading commit data...
spi-brcmstb-qspi.c Loading commit data...
spi-butterfly.c Loading commit data...
spi-cadence.c Loading commit data...
spi-cavium-octeon.c Loading commit data...
spi-cavium-thunderx.c Loading commit data...
spi-cavium.c Loading commit data...
spi-cavium.h Loading commit data...
spi-clps711x.c Loading commit data...
spi-coldfire-qspi.c Loading commit data...
spi-davinci.c Loading commit data...
spi-dln2.c Loading commit data...
spi-dw-mid.c Loading commit data...
spi-dw-mmio.c Loading commit data...
spi-dw-pci.c Loading commit data...
spi-dw.c Loading commit data...
spi-dw.h Loading commit data...
spi-efm32.c Loading commit data...
spi-ep93xx.c Loading commit data...
spi-falcon.c Loading commit data...
spi-fsl-cpm.c Loading commit data...
spi-fsl-cpm.h Loading commit data...
spi-fsl-dspi.c Loading commit data...
spi-fsl-espi.c Loading commit data...
spi-fsl-lib.c Loading commit data...
spi-fsl-lib.h Loading commit data...
spi-fsl-lpspi.c Loading commit data...
spi-fsl-spi.c Loading commit data...
spi-fsl-spi.h Loading commit data...
spi-gpio.c Loading commit data...
spi-img-spfi.c Loading commit data...
spi-imx.c Loading commit data...
spi-iproc-qspi.c Loading commit data...
spi-jcore.c Loading commit data...
spi-lantiq-ssc.c Loading commit data...
spi-lm70llp.c Loading commit data...
spi-loopback-test.c Loading commit data...
spi-lp8841-rtc.c Loading commit data...
spi-meson-spicc.c Loading commit data...
spi-meson-spifc.c Loading commit data...
spi-mpc512x-psc.c Loading commit data...
spi-mpc52xx-psc.c Loading commit data...
spi-mpc52xx.c Loading commit data...
spi-mt65xx.c Loading commit data...
spi-mxs.c Loading commit data...
spi-nuc900.c Loading commit data...
spi-oc-tiny.c Loading commit data...
spi-omap-100k.c Loading commit data...
spi-omap-uwire.c Loading commit data...
spi-omap2-mcspi.c Loading commit data...
spi-orion.c Loading commit data...
spi-pic32-sqi.c Loading commit data...
spi-pic32.c Loading commit data...
spi-pl022.c Loading commit data...
spi-ppc4xx.c Loading commit data...
spi-pxa2xx-dma.c Loading commit data...
spi-pxa2xx-pci.c Loading commit data...
spi-pxa2xx.c Loading commit data...
spi-pxa2xx.h Loading commit data...
spi-qup.c Loading commit data...
spi-rb4xx.c Loading commit data...
spi-rockchip.c Loading commit data...
spi-rspi.c Loading commit data...
spi-s3c24xx-fiq.S Loading commit data...
spi-s3c24xx-fiq.h Loading commit data...
spi-s3c24xx.c Loading commit data...
spi-s3c64xx.c Loading commit data...
spi-sc18is602.c Loading commit data...
spi-sh-hspi.c Loading commit data...
spi-sh-msiof.c Loading commit data...
spi-sh-sci.c Loading commit data...
spi-sh.c Loading commit data...
spi-sirf.c Loading commit data...
spi-slave-system-control.c Loading commit data...
spi-slave-time.c Loading commit data...
spi-st-ssc4.c Loading commit data...
spi-stm32.c Loading commit data...
spi-sun4i.c Loading commit data...
spi-sun6i.c Loading commit data...
spi-tegra114.c Loading commit data...
spi-tegra20-sflash.c Loading commit data...
spi-tegra20-slink.c Loading commit data...
spi-test.h Loading commit data...
spi-ti-qspi.c Loading commit data...
spi-tle62x0.c Loading commit data...
spi-topcliff-pch.c Loading commit data...
spi-txx9.c Loading commit data...
spi-xcomm.c Loading commit data...
spi-xilinx.c Loading commit data...
spi-xlp.c Loading commit data...
spi-xtensa-xtfpga.c Loading commit data...
spi-zynqmp-gqspi.c Loading commit data...
spi.c Loading commit data...
spidev.c Loading commit data...