On Wed, Mar 7, 2012 at 4:03 AM, Russell King - ARM Linux
[off-list ref] wrote:
[v2 - more or less same description. =C2=A0Including lakml in cc for the =
full
set]
This patch series cleans up the handling of cookies in DMA engine drivers=
.
This is done by providing a set of inline library functions for common
tasks:
- moving the 'last completed cookie' into struct dma_chan - everyone
=C2=A0has this in their driver private channel data structure
- consolidate allocation of cookies to DMA descriptors
- common way to update 'last completed cookie' value
- standard way to implement tx_status callback and update the residue
- consolidate initialization of cookies
- update implementations differing from the majority of DMA engine driver=
s
=C2=A0to behave the same as the majority implementation in respect of coo=
kies
What this means is that we get to the point where all DMA engine drivers
will hand out cookie value '2' as the first, and incrementing cookie
values up to INT_MAX, returning to cookie '1' as the next cookie.
Think of this patch series as round 1... =C2=A0I am hoping over time that=
more
code can be consolidated between the DMA engine drivers and end up with a
consistent way to handle various common themes in DMA engine hardware
(like physical channel<->peripheral request signal selection.)
Compilation is broken without the following minor fix.
After that you may add
Acked-by: Jassi Brar [off-list ref]
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 49c123f..abf35a3 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -339,7 +339,6 @@ static int pl330_control(struct dma_chan *chan,
enum dma_ctrl_cmd cmd, unsigned
/* Mark all desc done */
list_for_each_entry_safe(desc, _dt, &pch->work_list , node) {
desc->status =3D DONE;
- pch->completed =3D desc->txd.cookie;
list_move_tail(&desc->node, &list);
}
Thanks.