[lkml]   [2012]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH v4 2/2] dma/imx-sdma: convert _raw_readl/_raw_writel to readl/writel
    On Mon, Jan 9, 2012 at 7:51 PM, Russell King - ARM Linux
    <> wrote:
    > On Sun, Jan 08, 2012 at 10:44:22PM +0800, Richard Zhao wrote:
    >> readl/writel is more genric. And if CONFIG_ARM_DMA_MEM_BUFFERABLE,
    >> they includes necessary memory barriers.
    > In a DMA engine driver, you need to use the barrier accessors when:
    > 1. You finally enable the DMA engine to perform a transfer.
    >   The included barrier ensures that writes to the descriptors are visible
    >   to the DMA engine.
    > 2. You read from a status register before examining the descriptors.
    >   This ensures that the descriptor accesses won't be ordered before the
    >   status register read.
    > Provided other accesses are within the same 1K region, the remainder of
    > them do not have to be the strictly ordered accessors, and you can use
    > the _relaxed variants (but only in ARM specific drivers.)


    Does this also mean when endian conversion is not necessary, the __raw_*
    version will be better here? Or generally the _relaxed variants are more
    recommended as endian conversion will be optimized away anyway with
    these AMBA accesses as both sides are little-endian?

    > So, if your DMA engine has a control register, and a descriptor pointer
    > register, you can write the descriptor pointer register with a
    > writel_relaxed().  When you write the control register to enable the
    > transfer, use writel() to ensure there's a barrier so the descriptors
    > are visible.
    > _______________________________________________
    > linux-arm-kernel mailing list
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2012-01-09 14:27    [W:0.020 / U:22.596 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site