Skip to content

DMA engine cookie handling cleanups

Russell King - ARM Linux linux-arm-kernel linuxppc-dev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 of 9 patches 0 repliesNew

8 of 9 patches are in this archive. The cover letter announces 9.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
2/9dmaengine: move last completed cookie into generic dma_chan structurearch/arm/include/asm/hardware/iop_adma.h drivers/dma/amba-pl08x.c drivers/dma/at_hdmac.c +34 more+83 -1190 replies
3/9dmaengine: add private header filedrivers/dma/amba-pl08x.c drivers/dma/at_hdmac.c drivers/dma/coh901318.c +21 more+49 -01 reply
4/9dmaengine: consolidate assignment of DMA cookiesdrivers/dma/amba-pl08x.c drivers/dma/at_hdmac.c drivers/dma/coh901318.c +22 more+52 -2710 replies
5/9dmaengine: provide a common function for completing a dma descriptordrivers/dma/amba-pl08x.c drivers/dma/at_hdmac.c drivers/dma/coh901318.c +16 more+36 -210 replies
6/9dmaengine: consolidate tx_status functionsdrivers/dma/amba-pl08x.c drivers/dma/at_hdmac.c drivers/dma/coh901318.c +20 more+93 -2352 replies
6/9dmaengine: consolidate tx_status functions+0 -00 replies
7/9dmaengine: consolidate initialization of cookiesdrivers/dma/amba-pl08x.c drivers/dma/at_hdmac.c drivers/dma/coh901318.c +12 more+31 -280 replies
9/9dmaengine: ensure all DMA engine drivers initialize their cookiesdrivers/dma/fsldma.c drivers/dma/imx-dma.c drivers/dma/imx-sdma.c +6 more+9 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] DMA engine cookie handling cleanups

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 has 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 drivers to behave the same as the majority implementation in respect of cookies

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... I 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.)

I've only build-tested this stuff on a few ARM configs, and my ability to run-test this stuff is even more limited by all the broken useless DMA engine hardware I have access to (mostly pl08x based) so having some tested-bys would be a great advantage.

Overall, the diffstat looks like this:

 arch/arm/include/asm/hardware/iop_adma.h |    2 -
 drivers/dma/amba-pl08x.c                 |   38 ++++---------
 drivers/dma/at_hdmac.c                   |   48 ++++------------
 drivers/dma/at_hdmac_regs.h              |    2 -
 drivers/dma/coh901318.c                  |   39 +++----------
 drivers/dma/dmaengine.h                  |   89 ++++++++++++++++++++++++++++++
 drivers/dma/dw_dmac.c                    |   43 +++-----------
 drivers/dma/dw_dmac_regs.h               |    1 -
 drivers/dma/ep93xx_dma.c                 |   25 ++------
 drivers/dma/fsldma.c                     |   24 ++------
 drivers/dma/fsldma.h                     |    1 -
 drivers/dma/imx-dma.c                    |   32 ++---------
 drivers/dma/imx-sdma.c                   |   23 ++------
 drivers/dma/intel_mid_dma.c              |   37 +++---------
 drivers/dma/intel_mid_dma_regs.h         |    2 -
 drivers/dma/ioat/dma.c                   |   21 +++----
 drivers/dma/ioat/dma.h                   |   23 --------
 drivers/dma/ioat/dma_v2.c                |   13 ++---
 drivers/dma/ioat/dma_v3.c                |   11 ++--
 drivers/dma/iop-adma.c                   |   51 ++++-------------
 drivers/dma/ipu/ipu_idmac.c              |   22 ++-----
 drivers/dma/mpc512x_dma.c                |   25 +++------
 drivers/dma/mv_xor.c                     |   34 ++---------
 drivers/dma/mv_xor.h                     |    3 -
 drivers/dma/mxs-dma.c                    |   23 ++------
 drivers/dma/pch_dma.c                    |   34 ++---------
 drivers/dma/pl330.c                      |   36 ++----------
 drivers/dma/ppc4xx/adma.c                |   49 +++-------------
 drivers/dma/ppc4xx/adma.h                |    2 -
 drivers/dma/shdma.c                      |   30 +++-------
 drivers/dma/shdma.h                      |    1 -
 drivers/dma/sirf-dma.c                   |   23 ++------
 drivers/dma/ste_dma40.c                  |   36 +++---------
 drivers/dma/timb_dma.c                   |   28 +++-------
 drivers/dma/txx9dmac.c                   |   41 +++-----------
 drivers/dma/txx9dmac.h                   |    1 -
 include/linux/amba/pl08x.h               |    2 -
 include/linux/dmaengine.h                |    2 +
 38 files changed, 291 insertions(+), 626 deletions(-)