Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145410
b: refs/heads/master
c: bcfb746
h: refs/heads/master
v: v3
  • Loading branch information
Ira Snyder authored and Li Yang committed May 22, 2009
1 parent 80dde50 commit e511161
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 138ef0185177a6d221d24b6aa8f12d867fbbef90
refs/heads/master: bcfb7465c03a8c62c89da374677df56f6b894d44
21 changes: 12 additions & 9 deletions trunk/drivers/dma/fsldma.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,23 +313,26 @@ static void fsl_chan_toggle_ext_start(struct fsl_dma_chan *fsl_chan, int enable)

static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
{
struct fsl_desc_sw *desc = tx_to_fsl_desc(tx);
struct fsl_dma_chan *fsl_chan = to_fsl_chan(tx->chan);
struct fsl_desc_sw *desc;
unsigned long flags;
dma_cookie_t cookie;

/* cookie increment and adding to ld_queue must be atomic */
spin_lock_irqsave(&fsl_chan->desc_lock, flags);

cookie = fsl_chan->common.cookie;
cookie++;
if (cookie < 0)
cookie = 1;
desc->async_tx.cookie = cookie;
fsl_chan->common.cookie = desc->async_tx.cookie;

append_ld_queue(fsl_chan, desc);
list_splice_init(&desc->async_tx.tx_list, fsl_chan->ld_queue.prev);
list_for_each_entry(desc, &tx->tx_list, node) {
cookie++;
if (cookie < 0)
cookie = 1;

desc->async_tx.cookie = cookie;
}

fsl_chan->common.cookie = cookie;
append_ld_queue(fsl_chan, tx_to_fsl_desc(tx));
list_splice_init(&tx->tx_list, fsl_chan->ld_queue.prev);

spin_unlock_irqrestore(&fsl_chan->desc_lock, flags);

Expand Down

0 comments on commit e511161

Please sign in to comment.