diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:34:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:06:06 -0400 |
commit | 4d4e58de32a192fea65ab84509d17d199bd291c8 (patch) | |
tree | be35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/ppc4xx | |
parent | 08714f60b0fc6ea3a060b69b32e77139f14e6045 (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/ppc4xx')
-rw-r--r-- | drivers/dma/ppc4xx/adma.c | 10 | ||||
-rw-r--r-- | drivers/dma/ppc4xx/adma.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index fc457a7e883..f878322ecbc 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c | |||
@@ -1930,7 +1930,7 @@ static void __ppc440spe_adma_slot_cleanup(struct ppc440spe_adma_chan *chan) | |||
1930 | if (end_of_chain && slot_cnt) { | 1930 | if (end_of_chain && slot_cnt) { |
1931 | /* Should wait for ZeroSum completion */ | 1931 | /* Should wait for ZeroSum completion */ |
1932 | if (cookie > 0) | 1932 | if (cookie > 0) |
1933 | chan->completed_cookie = cookie; | 1933 | chan->common.completed_cookie = cookie; |
1934 | return; | 1934 | return; |
1935 | } | 1935 | } |
1936 | 1936 | ||
@@ -1960,7 +1960,7 @@ static void __ppc440spe_adma_slot_cleanup(struct ppc440spe_adma_chan *chan) | |||
1960 | BUG_ON(!seen_current); | 1960 | BUG_ON(!seen_current); |
1961 | 1961 | ||
1962 | if (cookie > 0) { | 1962 | if (cookie > 0) { |
1963 | chan->completed_cookie = cookie; | 1963 | chan->common.completed_cookie = cookie; |
1964 | pr_debug("\tcompleted cookie %d\n", cookie); | 1964 | pr_debug("\tcompleted cookie %d\n", cookie); |
1965 | } | 1965 | } |
1966 | 1966 | ||
@@ -3950,7 +3950,7 @@ static enum dma_status ppc440spe_adma_tx_status(struct dma_chan *chan, | |||
3950 | 3950 | ||
3951 | ppc440spe_chan = to_ppc440spe_adma_chan(chan); | 3951 | ppc440spe_chan = to_ppc440spe_adma_chan(chan); |
3952 | last_used = chan->cookie; | 3952 | last_used = chan->cookie; |
3953 | last_complete = ppc440spe_chan->completed_cookie; | 3953 | last_complete = chan->completed_cookie; |
3954 | 3954 | ||
3955 | dma_set_tx_state(txstate, last_complete, last_used, 0); | 3955 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
3956 | 3956 | ||
@@ -3961,7 +3961,7 @@ static enum dma_status ppc440spe_adma_tx_status(struct dma_chan *chan, | |||
3961 | ppc440spe_adma_slot_cleanup(ppc440spe_chan); | 3961 | ppc440spe_adma_slot_cleanup(ppc440spe_chan); |
3962 | 3962 | ||
3963 | last_used = chan->cookie; | 3963 | last_used = chan->cookie; |
3964 | last_complete = ppc440spe_chan->completed_cookie; | 3964 | last_complete = chan->completed_cookie; |
3965 | 3965 | ||
3966 | dma_set_tx_state(txstate, last_complete, last_used, 0); | 3966 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
3967 | 3967 | ||
@@ -4058,7 +4058,7 @@ static void ppc440spe_chan_start_null_xor(struct ppc440spe_adma_chan *chan) | |||
4058 | /* initialize the completed cookie to be less than | 4058 | /* initialize the completed cookie to be less than |
4059 | * the most recently used cookie | 4059 | * the most recently used cookie |
4060 | */ | 4060 | */ |
4061 | chan->completed_cookie = cookie - 1; | 4061 | chan->common.completed_cookie = cookie - 1; |
4062 | chan->common.cookie = sw_desc->async_tx.cookie = cookie; | 4062 | chan->common.cookie = sw_desc->async_tx.cookie = cookie; |
4063 | 4063 | ||
4064 | /* channel should not be busy */ | 4064 | /* channel should not be busy */ |
diff --git a/drivers/dma/ppc4xx/adma.h b/drivers/dma/ppc4xx/adma.h index 8ada5a812e3..26b7a5ed9ac 100644 --- a/drivers/dma/ppc4xx/adma.h +++ b/drivers/dma/ppc4xx/adma.h | |||
@@ -81,7 +81,6 @@ struct ppc440spe_adma_device { | |||
81 | * @common: common dmaengine channel object members | 81 | * @common: common dmaengine channel object members |
82 | * @all_slots: complete domain of slots usable by the channel | 82 | * @all_slots: complete domain of slots usable by the channel |
83 | * @pending: allows batching of hardware operations | 83 | * @pending: allows batching of hardware operations |
84 | * @completed_cookie: identifier for the most recently completed operation | ||
85 | * @slots_allocated: records the actual size of the descriptor slot pool | 84 | * @slots_allocated: records the actual size of the descriptor slot pool |
86 | * @hw_chain_inited: h/w descriptor chain initialization flag | 85 | * @hw_chain_inited: h/w descriptor chain initialization flag |
87 | * @irq_tasklet: bottom half where ppc440spe_adma_slot_cleanup runs | 86 | * @irq_tasklet: bottom half where ppc440spe_adma_slot_cleanup runs |
@@ -99,7 +98,6 @@ struct ppc440spe_adma_chan { | |||
99 | struct list_head all_slots; | 98 | struct list_head all_slots; |
100 | struct ppc440spe_adma_desc_slot *last_used; | 99 | struct ppc440spe_adma_desc_slot *last_used; |
101 | int pending; | 100 | int pending; |
102 | dma_cookie_t completed_cookie; | ||
103 | int slots_allocated; | 101 | int slots_allocated; |
104 | int hw_chain_inited; | 102 | int hw_chain_inited; |
105 | struct tasklet_struct irq_tasklet; | 103 | struct tasklet_struct irq_tasklet; |