summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorBoojin Kim <boojin.kim@samsung.com>2011-09-02 09:44:32 +0900
committerVinod Koul <vinod.koul@intel.com>2011-09-14 11:10:01 +0530
commitae43b886f174297366d4e09a008ad8e6592d95df (patch)
treeff52b7da54a8a9f2e4126413d7a38c5f8f8c8d7b /drivers/dma
parent1d0c1d606d787e833ee3bd9e1cda640e75c4681a (diff)
downloadlinux-3.10-ae43b886f174297366d4e09a008ad8e6592d95df.tar.gz
linux-3.10-ae43b886f174297366d4e09a008ad8e6592d95df.tar.bz2
linux-3.10-ae43b886f174297366d4e09a008ad8e6592d95df.zip
DMA: PL330: Remove the start operation for handling DMA_TERMINATE_ALL command
Original code carries out the start operation after flush operation. But start operation is not required for DMA_TERMINATE_ALL command. So, this patch removes the unnecessary start operation and only carries out the flush operation for handling DMA_TERMINATE_ALL command. Signed-off-by: Boojin Kim <boojin.kim@samsung.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Vinod Koul <vinod.koul@intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com> [Fixed typos in changelog] Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/pl330.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index e7f9d1d3d81..59943ec1e74 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -262,10 +262,11 @@ static int pl330_alloc_chan_resources(struct dma_chan *chan)
static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, unsigned long arg)
{
struct dma_pl330_chan *pch = to_pchan(chan);
- struct dma_pl330_desc *desc;
+ struct dma_pl330_desc *desc, *_dt;
unsigned long flags;
struct dma_pl330_dmac *pdmac = pch->dmac;
struct dma_slave_config *slave_config;
+ LIST_HEAD(list);
switch (cmd) {
case DMA_TERMINATE_ALL:
@@ -275,12 +276,14 @@ static int pl330_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, unsigned
pl330_chan_ctrl(pch->pl330_chid, PL330_OP_FLUSH);
/* Mark all desc done */
- list_for_each_entry(desc, &pch->work_list, node)
+ list_for_each_entry_safe(desc, _dt, &pch->work_list , node) {
desc->status = DONE;
+ pch->completed = desc->txd.cookie;
+ list_move_tail(&desc->node, &list);
+ }
+ list_splice_tail_init(&list, &pdmac->desc_pool);
spin_unlock_irqrestore(&pch->lock, flags);
-
- pl330_tasklet((unsigned long) pch);
break;
case DMA_SLAVE_CONFIG:
slave_config = (struct dma_slave_config *)arg;