linux/drivers/dma
Joel Fernandes c5f47990aa dma: edma: Find missed events and issue them
In an effort to move to using Scatter gather lists of any size with
EDMA as discussed at [1] instead of placing limitations on the driver,
we work through the limitations of the EDMAC hardware to find missed
events and issue them.

The sequence of events that require this are:

For the scenario where MAX slots for an EDMA channel is 3:

SG1 -> SG2 -> SG3 -> SG4 -> SG5 -> SG6 -> Null

The above SG list will have to be DMA'd in 2 sets:

(1) SG1 -> SG2 -> SG3 -> Null
(2) SG4 -> SG5 -> SG6 -> Null

After (1) is succesfully transferred, the events from the MMC controller
donot stop coming and are missed by the time we have setup the transfer
for (2). So here, we catch the events missed as an error condition and
issue them manually.

In the second part of the patch, we make handle the NULL slot cases:
For crypto IP, we continue to receive events even continuously in
NULL slot, the setup of the next set of SG elements happens after
the error handler executes. This is results in some recursion problems.
Due to this, we continously receive error interrupts when we manually
trigger an event from the error handler.

We fix this, by first detecting if the Channel is currently transferring
from a NULL slot or not, that's where the edma_read_slot in the error
callback from interrupt handler comes in. With this we can determine if
the set up of the next SG list has completed, and we manually trigger
only in this case. If the setup has _not_ completed, we are still in NULL
so we just set a missed flag and allow the manual triggerring to happen
in edma_execute which will be eventually called. This fixes the above
mentioned race conditions seen with the crypto drivers.

[1] http://marc.info/?l=linux-omap&m=137416733628831&w=2

Signed-off-by: Joel Fernandes <joelf@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2013-09-04 18:38:46 +05:30
..
bestcomm Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-02-23 17:09:55 -08:00
dw dma: dw: return DMA_PAUSED only if cookie status is DMA_IN_PROGRESS 2013-08-05 09:32:26 +05:30
ioat drivers/dma: remove unused support for MEMSET operations 2013-07-03 16:07:42 -07:00
ipu dma: ipu: remove unnecessary platform_set_drvdata() 2013-08-25 14:37:13 +05:30
ppc4xx Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2013-07-07 11:11:43 -07:00
sh Merge branch 'topic/sh' into for-linus 2013-09-02 17:42:35 +05:30
acpi-dma.c acpi-dma: remove ugly conversion 2013-08-25 16:43:45 +05:30
amba-pl08x.c dmaengine: PL08x: Add cyclic transfer support 2013-09-02 11:49:56 +05:30
at_hdmac.c dmaengine: at_hdmac: prepare clk before calling enable 2013-07-05 11:40:57 +05:30
at_hdmac_regs.h DMA: AT91: Get residual bytes in dma buffer 2013-07-05 11:40:31 +05:30
coh901318.c dma: coh901318: add devicetree support 2013-06-17 13:54:27 +02:00
coh901318.h dma: coh901318: merge header files 2013-01-07 17:36:37 +01:00
coh901318_lli.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-02-26 09:24:48 -08:00
dma-jz4740.c MIPS: jz4740: Remove custom DMA API 2013-07-05 11:40:52 +05:30
dmaengine.c Merge branch 'topic/of' into for-linus 2013-09-02 17:40:46 +05:30
dmaengine.h dmaengine: consolidate initialization of cookies 2012-03-13 11:37:22 +05:30
dmatest.c dmatest: do not allow to interrupt ongoing tests 2013-06-08 02:13:44 +05:30
edma.c dma: edma: Find missed events and issue them 2013-09-04 18:38:46 +05:30
ep93xx_dma.c ep93xx_dma: remove useless use of lock 2013-08-05 09:32:24 +05:30
fsldma.c fsldma: remove useless use of lock 2013-08-05 09:32:24 +05:30
fsldma.h dmaengine: move last completed cookie into generic dma_chan structure 2012-03-13 11:36:06 +05:30
imx-dma.c dma: imx-dma: Remove redundant NULL check 2013-09-02 17:35:58 +05:30
imx-sdma.c dma: imx-sdma: Staticize sdma_driver_data structures 2013-09-02 12:00:02 +05:30
intel_mid_dma.c PM / Runtime: Rework the "runtime idle" helper routine 2013-06-03 21:49:52 +02:00
intel_mid_dma_regs.h dma: fix comments 2012-09-01 08:57:12 -07:00
iop-adma.c dma: use dev_get_platdata() 2013-08-13 16:56:41 +05:30
iovlock.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
k3dma.c dma: k3dma: use devm_ioremap_resource() instead of devm_request_and_ioremap() 2013-09-02 17:35:34 +05:30
Kconfig dmaengine: Add hisilicon k3 DMA engine driver 2013-08-28 11:23:40 +05:30
Makefile dmaengine: Add hisilicon k3 DMA engine driver 2013-08-28 11:23:40 +05:30
mmp_pdma.c dma: mmp_pdma: set DMA_PRIVATE 2013-08-25 22:04:53 +05:30
mmp_tdma.c dma: mmp: simplify use of devm_ioremap_resource 2013-08-14 14:51:28 +05:30
mpc512x_dma.c mpc512x_dma: remove useless use of lock 2013-08-05 09:32:25 +05:30
mv_xor.c dma: use dev_get_platdata() 2013-08-13 16:56:41 +05:30
mv_xor.h drivers/dma: remove unused support for MEMSET operations 2013-07-03 16:07:42 -07:00
mxs-dma.c dma: mxs-dma: remove code left from generic DMA binding conversion 2013-08-19 14:20:21 +05:30
of-dma.c dma: of: make error message more meaningful by adding the node name 2013-08-19 14:45:05 +05:30
omap-dma.c dmaengine: OMAP: Register SDMA controller with Device Tree DMA driver 2013-04-15 09:51:19 +05:30
pch_dma.c pch_dma: Add MODULE_DEVICE_TABLE 2013-09-02 11:59:58 +05:30
pl330.c Merge branch 'topic/api_caps' into for-linus 2013-09-04 18:36:53 +05:30
sa11x0-dma.c Drivers: dma: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
sirf-dma.c dmaengine: sirf: add PM entries for sleep and runtime 2013-08-13 17:01:01 +05:30
ste_dma40.c dma: ste_dma40: Fix potential null pointer dereference 2013-09-02 17:36:00 +05:30
ste_dma40_ll.c dmaengine: ste_dma40_ll: Replace meaningless register set with comment 2013-06-04 11:12:10 +02:00
ste_dma40_ll.h dmaengine: ste_dma40: Remove unnecessary call to d40_phy_cfg() 2013-05-23 21:13:19 +02:00
tegra20-apb-dma.c tegra20-apb-dma: remove useless use of lock 2013-08-05 09:32:25 +05:30
timb_dma.c dma: use dev_get_platdata() 2013-08-13 16:56:41 +05:30
TODO dmaengine: remove ste_dma40 from issue_pending TODO 2011-07-14 04:02:08 +05:30
txx9dmac.c dma: use dev_get_platdata() 2013-08-13 16:56:41 +05:30
txx9dmac.h dmaengine: move last completed cookie into generic dma_chan structure 2012-03-13 11:36:06 +05:30
virt-dma.c dmaengine: virt-dma: add support for cyclic DMA periodic callbacks 2012-07-01 14:15:23 +01:00
virt-dma.h dmaengine: virt-dma: add support for cyclic DMA periodic callbacks 2012-07-01 14:15:23 +01:00