linux-stable/drivers/dma
Sebastian Andrzej Siewior 9934075471 dmaengine: omap-dma: add support for pause of non-cyclic transfers
This DMA driver is used by 8250-omap on DRA7-evm. There is one
requirement that is to pause a transfer. This is currently used on the RX
side. It is possible that the UART HW aborted the RX (UART's RX-timeout)
but the DMA controller starts the transfer shortly after.
Before we can manually purge the FIFO we need to pause the transfer,
check how many bytes it already received and terminate the transfer
without it making any progress.

From testing on the TX side it seems that it is possible that we invoke
pause once the transfer has completed which is indicated by the missing
CCR_ENABLE bit but before the interrupt has been noticed. In that case the
interrupt will come even after disabling it.

The AM572x manual says that we have to wait for the CCR_RD_ACTIVE &
CCR_WR_ACTIVE bits to be gone before programming it again here is the
drain loop. Also it looks like without the drain the TX-transfer makes
sometimes progress.

One note: The pause + resume combo is broken because after resume the
the complete transfer will be programmed again. That means the already
transferred bytes (until the pause event) will be sent again. This is
currently not important for my UART user because it does only pause +
terminate.

v3…v4:
 - update subject line.

v2…v3:
  - rephrase the comment based on Russell's information / feedback.

v1…v2:
  - move the drain loop into omap_dma_drain_chan() instead of having it
    twice.
  - allow pause only for DMA_DEV_TO_MEM transfers if non-cyclic. Add a
    comment why DMA_MEM_TO_DEV not allowed.
  - clear pause on terminate_all. Otherwise pause() + terminate_all()
    will keep the pause bit set and we can't pause the following
    transfer.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[vigneshr@ti.com: drain channel only when buffering is on, rebase to v4.8]
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2016-10-18 20:22:01 +05:30
..
bestcomm dmaengine: NO_IRQ removal from powerpc-only drivers 2016-09-14 18:57:38 +05:30
dw dmaengine updates for 4.8-rc1 2016-10-06 17:13:54 -07:00
hsu dmaengine: hsu: refactor hsu_dma_do_irq() to return int 2016-09-15 21:15:40 +05:30
ioat Merge branch 'topic/ioatdma' into for-linus 2016-10-03 09:18:01 +05:30
ipu Merge branch 'topic/no_irq' into for-linus 2016-10-03 09:18:29 +05:30
ppc4xx Merge branch 'topic/unmap_cleanup' into for-linus 2016-10-03 09:36:11 +05:30
qcom dmaengine: qcom_hidma: add error reporting for tx_status 2016-08-31 21:27:32 +05:30
sh dmaengine updates for 4.8-rc1 2016-10-06 17:13:54 -07:00
xilinx dmengine: xilinx_dma: convert callback to helper function 2016-08-08 08:11:43 +05:30
acpi-dma.c dmaengine: acpi-dma: align debug message with flow 2016-02-22 09:06:09 +05:30
amba-pl08x.c dmaengine: Remove site specific OOM error messages on kzalloc 2016-06-21 21:35:00 +05:30
at_hdmac.c dmaengine: at_hdmac: convert callback to helper function 2016-08-08 08:11:38 +05:30
at_hdmac_regs.h dmaengine: at_hdmac: use %pad format string for dma_addr_t 2015-11-16 09:21:05 +05:30
at_xdmac.c dmaengine updates for 4.8-rc1 2016-10-06 17:13:54 -07:00
bcm2835-dma.c dmaengine: bcm2835: fix 64-bit warning 2016-07-06 22:39:43 +05:30
coh901318.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
coh901318.h
coh901318_lli.c dmaengine: coh901318: use NULL for pointer initialization 2016-09-26 22:28:24 +05:30
cppi41.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
dma-axi-dmac.c dmaengine: axi-dmac: Return IRQ_NONE if no IRQs are pending 2016-07-01 22:56:41 +05:30
dma-jz4740.c dmaengine: jz4740: remove unused arch header 2016-09-26 22:25:57 +05:30
dma-jz4780.c Merge branch 'topic/compile_test' into for-linus 2016-10-03 09:16:03 +05:30
dmaengine.c dmaengine: device must have at least one channel 2016-08-22 11:49:07 +05:30
dmaengine.h dmaengine: add support to provide error result from a DMA transation 2016-08-08 08:11:42 +05:30
dmatest.c dmaengine: dmatest: Restore "memcpy" as default mode 2016-09-15 21:17:58 +05:30
edma.c Merge branch 'topic/compile_test' into for-linus 2016-10-03 09:16:03 +05:30
ep93xx_dma.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
fsl-edma.c dmaengine: fsl-edma: kill the tasklets upon exit 2016-07-16 20:19:00 +05:30
fsl_raid.c dmaengine updates for 4.8-rc1 2016-10-06 17:13:54 -07:00
fsl_raid.h dmaengine: Driver support for FSL RaidEngine device. 2015-04-02 16:10:27 +05:30
fsldma.c Merge branch 'topic/unmap_cleanup' into for-linus 2016-10-03 09:36:11 +05:30
fsldma.h dmaengine: fsldma: declare slave capabilities for the generic code 2015-01-13 23:58:08 +05:30
idma64.c dmaengine: idma64: clear LLP_[SD]_EN bits in last descriptor 2016-02-15 22:06:45 +05:30
idma64.h asm-generic changes for 4.6 2016-03-24 23:13:48 -07:00
img-mdc-dma.c dmaengine: img-mdc: fix a possible NULL dereference 2016-08-22 11:57:49 +05:30
imx-dma.c dmaengine: imx-dma: convert callback to helper function 2016-08-08 08:11:39 +05:30
imx-sdma.c dmaengine updates for 4.8-rc1 2016-10-06 17:13:54 -07:00
iop-adma.c dmaengine: iop-adma: convert callback to helper function 2016-08-08 08:11:39 +05:30
k3dma.c dmaengine: k3dma: use correct format string for debug output 2016-09-07 13:38:43 +05:30
Kconfig Merge branch 'topic/k3' into for-linus 2016-10-03 09:18:14 +05:30
lpc18xx-dmamux.c dmaengine: add driver for lpc18xx dmamux 2015-08-18 22:12:14 +05:30
Makefile dmaengine: mv_xor_v2: new driver 2016-07-12 10:09:53 +05:30
mic_x100_dma.c dmaengine: mic_x100_dma: convert callback to helper function 2016-08-08 08:11:39 +05:30
mic_x100_dma.h dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
mmp_pdma.c dmaengine: mmp_pdma: convert callback to helper function 2016-08-08 08:11:39 +05:30
mmp_tdma.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
moxart-dma.c dmaengine: moxart: remove NO_IRQ 2016-09-05 16:40:52 +05:30
mpc512x_dma.c Merge branch 'topic/err_reporting' into for-linus 2016-10-03 09:17:33 +05:30
mv_xor.c Merge branch 'topic/unmap_cleanup' into for-linus 2016-10-03 09:36:11 +05:30
mv_xor.h dmaengine: mv_xor: Add support for IO (PCIe) src/dst areas 2016-09-15 21:13:59 +05:30
mv_xor_v2.c dmaengine: mv_xor_v2: remove trailing whitespace 2016-07-12 10:10:00 +05:30
mxs-dma.c Merge branch 'topic/no_irq' into for-linus 2016-10-03 09:18:29 +05:30
nbpfaxi.c dmaengine: nbpfaxi: convert callback to helper function 2016-08-08 08:11:40 +05:30
of-dma.c dmaengine: of_dma: approximate an average distribution 2016-05-14 13:34:10 +05:30
omap-dma.c dmaengine: omap-dma: add support for pause of non-cyclic transfers 2016-10-18 20:22:01 +05:30
pch_dma.c dmaengine: pch_dma: convert callback to helper function 2016-08-08 08:11:40 +05:30
pl330.c Merge branch 'topic/pl330' into for-linus 2016-10-03 09:19:03 +05:30
pxa_dma.c dmaengine: pxa_dma: fix debug message 2016-08-19 16:17:26 +05:30
s3c24xx-dma.c Merge branch 'topic/compile_test' into for-linus 2016-10-03 09:16:03 +05:30
sa11x0-dma.c dmaengine: sa11x0: use correct print specifiers for size_t 2016-09-26 22:29:26 +05:30
sirf-dma.c Merge branch 'topic/no_irq' into for-linus 2016-10-03 09:18:29 +05:30
ste_dma40.c Merge branch 'topic/ste_dma40' into for-linus 2016-10-03 09:35:55 +05:30
ste_dma40_ll.c dmaengine: ste_dma40_ll: make d40_width_to_bits static 2016-06-08 08:59:55 +05:30
ste_dma40_ll.h
stm32-dma.c dmaengine: stm32-dma: make stm32_dma_set_config static 2016-09-26 22:31:36 +05:30
sun4i-dma.c remove lots of IS_ERR_VALUE abuses 2016-05-27 15:26:11 -07:00
sun6i-dma.c dmaengine: sun6i: Add support for Allwinner A83T (sun8i) variant 2016-09-26 23:15:06 +05:30
tegra20-apb-dma.c dmaengine: tegra20-apb-dma: convert callback to helper function 2016-08-08 08:11:41 +05:30
tegra210-adma.c dmaengine: tegra210-adma: Update driver to use of_pm_clk_add_clk 2016-08-22 11:55:05 +05:30
ti-dma-crossbar.c dmaengine: ti-dma-crossbar: Fix of_device_id data parameter usage 2016-09-28 08:54:28 +05:30
timb_dma.c dmaengine: timb_dma: convert callback to helper function 2016-08-08 08:11:41 +05:30
TODO
txx9dmac.c dmaengine: txx9dmac: convert callback to helper function 2016-08-08 08:11:41 +05:30
txx9dmac.h MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT 2014-11-24 22:46:44 +01:00
virt-dma.c dmaengine: virt-dma: convert callback to helper function 2016-08-08 08:11:41 +05:30
virt-dma.h dmaengine: virt-dma: move function declarations 2016-10-01 11:41:39 +05:30
xgene-dma.c dmaengine: xgene-dma: move unmap to before callback 2016-08-08 08:11:43 +05:30
zx296702_dma.c dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00