Skip to content

Commit

Permalink
DMA: PL330: Remove the start operation for handling DMA_TERMINATE_ALL…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Boojin Kim authored and Vinod Koul committed Sep 14, 2011
1 parent 1d0c1d6 commit ae43b88
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand 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;
Expand Down

0 comments on commit ae43b88

Please sign in to comment.