aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/ioat
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 17:34:06 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-03-13 02:06:06 -0400
commit4d4e58de32a192fea65ab84509d17d199bd291c8 (patch)
treebe35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/ioat
parent08714f60b0fc6ea3a060b69b32e77139f14e6045 (diff)
dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie in their private dma channel structures. This is pointless, and forces driver specific code. Move this out into the common dma_chan structure. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> [imx-sdma.c & mxs-dma.c] Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/ioat')
-rw-r--r--drivers/dma/ioat/dma.c2
-rw-r--r--drivers/dma/ioat/dma.h4
-rw-r--r--drivers/dma/ioat/dma_v2.c2
-rw-r--r--drivers/dma/ioat/dma_v3.c2
4 files changed, 4 insertions, 6 deletions
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index a4d6cb0c0343..fab440af1f9a 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -603,7 +603,7 @@ static void __cleanup(struct ioat_dma_chan *ioat, unsigned long phys_complete)
603 */ 603 */
604 dump_desc_dbg(ioat, desc); 604 dump_desc_dbg(ioat, desc);
605 if (tx->cookie) { 605 if (tx->cookie) {
606 chan->completed_cookie = tx->cookie; 606 chan->common.completed_cookie = tx->cookie;
607 tx->cookie = 0; 607 tx->cookie = 0;
608 ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw); 608 ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw);
609 ioat->active -= desc->hw->tx_cnt; 609 ioat->active -= desc->hw->tx_cnt;
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index 5216c8a92a21..9653b6b6a715 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -90,7 +90,6 @@ struct ioat_chan_common {
90 void __iomem *reg_base; 90 void __iomem *reg_base;
91 unsigned long last_completion; 91 unsigned long last_completion;
92 spinlock_t cleanup_lock; 92 spinlock_t cleanup_lock;
93 dma_cookie_t completed_cookie;
94 unsigned long state; 93 unsigned long state;
95 #define IOAT_COMPLETION_PENDING 0 94 #define IOAT_COMPLETION_PENDING 0
96 #define IOAT_COMPLETION_ACK 1 95 #define IOAT_COMPLETION_ACK 1
@@ -153,12 +152,11 @@ static inline enum dma_status
153ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie, 152ioat_tx_status(struct dma_chan *c, dma_cookie_t cookie,
154 struct dma_tx_state *txstate) 153 struct dma_tx_state *txstate)
155{ 154{
156 struct ioat_chan_common *chan = to_chan_common(c);
157 dma_cookie_t last_used; 155 dma_cookie_t last_used;
158 dma_cookie_t last_complete; 156 dma_cookie_t last_complete;
159 157
160 last_used = c->cookie; 158 last_used = c->cookie;
161 last_complete = chan->completed_cookie; 159 last_complete = c->completed_cookie;
162 160
163 dma_set_tx_state(txstate, last_complete, last_used, 0); 161 dma_set_tx_state(txstate, last_complete, last_used, 0);
164 162
diff --git a/drivers/dma/ioat/dma_v2.c b/drivers/dma/ioat/dma_v2.c
index 5d65f8377971..d3f0aff2c02a 100644
--- a/drivers/dma/ioat/dma_v2.c
+++ b/drivers/dma/ioat/dma_v2.c
@@ -147,7 +147,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
147 dump_desc_dbg(ioat, desc); 147 dump_desc_dbg(ioat, desc);
148 if (tx->cookie) { 148 if (tx->cookie) {
149 ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw); 149 ioat_dma_unmap(chan, tx->flags, desc->len, desc->hw);
150 chan->completed_cookie = tx->cookie; 150 chan->common.completed_cookie = tx->cookie;
151 tx->cookie = 0; 151 tx->cookie = 0;
152 if (tx->callback) { 152 if (tx->callback) {
153 tx->callback(tx->callback_param); 153 tx->callback(tx->callback_param);
diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
index f519c93a61e7..d4afac741e8a 100644
--- a/drivers/dma/ioat/dma_v3.c
+++ b/drivers/dma/ioat/dma_v3.c
@@ -277,7 +277,7 @@ static void __cleanup(struct ioat2_dma_chan *ioat, unsigned long phys_complete)
277 dump_desc_dbg(ioat, desc); 277 dump_desc_dbg(ioat, desc);
278 tx = &desc->txd; 278 tx = &desc->txd;
279 if (tx->cookie) { 279 if (tx->cookie) {
280 chan->completed_cookie = tx->cookie; 280 chan->common.completed_cookie = tx->cookie;
281 ioat3_dma_unmap(ioat, desc, idx + i); 281 ioat3_dma_unmap(ioat, desc, idx + i);
282 tx->cookie = 0; 282 tx->cookie = 0;
283 if (tx->callback) { 283 if (tx->callback) {