lkml.org 
[lkml]   [2011]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 06/13] DMAENGINE: driver for the ARM PL080/PL081 PrimeCells
    On Wed, Dec 22, 2010 at 03:45:39PM -0800, Dan Williams wrote:
    > Support for the DMA_COMPL flags are necessary if the DMA_MEMCPY
    > capability is advertised, yes this driver got this wrong. I'll update
    > the documentation to make this requirement clear, and audit the other
    > drivers. With slave-only drivers the only usage model is one where
    > the client driver owns dma-mapping. In the non-slave (opportunistic
    > memcpy offload) case the client is unaware of the engine so the driver
    > owns unmapping. The minimal fix is to disable memcpy offload.

    As a side note, the DMA mapping for slaves should be done using the
    DMA struct device, not the struct device of the peripheral making use
    of the DMA engine.

    Why? The slave device has no knowledge of how the DMA engine is
    connected into the system, or the DMA parameters associated with the
    device performing the DMA, such as the DMA mask and boundaries. (If
    there are several generic DMA agents in the system, it can't know
    which is the correct one to use until a channel has been allocated.)
    The only struct device which has this information is the one for the
    DMA engine itself.

    Therefore, the struct device which is passed into the DMA mapping APIs
    to prepare memory for DMA must always be the DMA engine struct device
    (chan->device->dev) and never the slave struct device.

    This is no different from USB - consider the slave devices to be USB
    peripherals, and the DMA engine device to be the USB host controller.
    The USB host controller performs all the DMA, and DMA mappings are
    setup and torn down against the DMA host controller device structure.


    \
     
     \ /
      Last update: 2011-01-01 16:19    [W:4.286 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site