From 81b846f4ddc8159f0615b682f8ab9537c195dc35 Mon Sep 17 00:00:00 2001 From: Russell King - ARM Linux Date: Mon, 3 Jan 2011 22:31:04 +0000 Subject: [PATCH] --- yaml --- r: 231567 b: refs/heads/master c: 91aa5fadb831e7b6ea473a526a6b49c6dc4819ce h: refs/heads/master i: 231565: c3ba4fd741c5e836d0609b1275a1879deb7c87a1 231563: 5b16e221921cbb222599d0272efcbcaa54b0fcfc 231559: 694d02e30906ab5c3c5a65775732124dd59390d2 231551: 4a8433c5a4adde247eb68c3a144bbc56eed98b1e v: v3 --- [refs] | 2 +- trunk/drivers/dma/amba-pl08x.c | 18 +++++++++--------- trunk/include/linux/amba/pl08x.h | 1 - 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 900773622ebd..9bcf8dd388d6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4440aacf3a171a0ab498feda58d100a320c5d9ff +refs/heads/master: 91aa5fadb831e7b6ea473a526a6b49c6dc4819ce diff --git a/trunk/drivers/dma/amba-pl08x.c b/trunk/drivers/dma/amba-pl08x.c index 0809810f9e7a..5d9a15652dba 100644 --- a/trunk/drivers/dma/amba-pl08x.c +++ b/trunk/drivers/dma/amba-pl08x.c @@ -74,7 +74,6 @@ #include #include #include -#include #include #include @@ -1082,8 +1081,10 @@ static dma_cookie_t pl08x_tx_submit(struct dma_async_tx_descriptor *tx) { struct pl08x_dma_chan *plchan = to_pl08x_chan(tx->chan); - atomic_inc(&plchan->last_issued); - tx->cookie = atomic_read(&plchan->last_issued); + plchan->chan.cookie += 1; + if (plchan->chan.cookie < 0) + plchan->chan.cookie = 1; + tx->cookie = plchan->chan.cookie; /* This unlock follows the lock in the prep() function */ spin_unlock_irqrestore(&plchan->lock, plchan->lockflags); @@ -1115,7 +1116,7 @@ pl08x_dma_tx_status(struct dma_chan *chan, enum dma_status ret; u32 bytesleft = 0; - last_used = atomic_read(&plchan->last_issued); + last_used = plchan->chan.cookie; last_complete = plchan->lc; ret = dma_async_is_complete(cookie, last_complete, last_used); @@ -1131,7 +1132,7 @@ pl08x_dma_tx_status(struct dma_chan *chan, /* * This cookie not complete yet */ - last_used = atomic_read(&plchan->last_issued); + last_used = plchan->chan.cookie; last_complete = plchan->lc; /* Get number of bytes left in the active transactions and queue */ @@ -1641,8 +1642,7 @@ static void pl08x_tasklet(unsigned long data) /* * Update last completed */ - plchan->lc = - (plchan->at->tx.cookie); + plchan->lc = plchan->at->tx.cookie; /* * Callback to signal completion @@ -1820,8 +1820,8 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, chan->name); chan->chan.device = dmadev; - atomic_set(&chan->last_issued, 0); - chan->lc = atomic_read(&chan->last_issued); + chan->chan.cookie = 0; + chan->lc = 0; spin_lock_init(&chan->lock); INIT_LIST_HEAD(&chan->desc_list); diff --git a/trunk/include/linux/amba/pl08x.h b/trunk/include/linux/amba/pl08x.h index 521a0f8974ac..4ae62b4684f9 100644 --- a/trunk/include/linux/amba/pl08x.h +++ b/trunk/include/linux/amba/pl08x.h @@ -174,7 +174,6 @@ struct pl08x_dma_chan { struct pl08x_channel_data *cd; dma_addr_t runtime_addr; enum dma_data_direction runtime_direction; - atomic_t last_issued; dma_cookie_t lc; struct list_head desc_list; struct pl08x_txd *at;