• Serge Semin's avatar
    dmaengine: dw: Discard dlen from the dev-to-mem xfer width calculation · 0ed725d1
    Serge Semin authored
    Indeed in case of the DMA_DEV_TO_MEM DMA transfers it's enough to take the
    destination memory address and the destination master data width into
    account to calculate the CTLx.DST_TR_WIDTH setting of the memory
    peripheral. According to the DW DMAC IP-core Databook 2.18b (page 66,
    Example 5) at the and of a DMA transfer when the DMA-channel internal FIFO
    is left with data less than for a single destination burst transaction,
    the destination peripheral will enter the Single Transaction Region where
    the DW DMA controller can complete a block transfer to the destination
    using single transactions (non-burst transaction of CTLx.DST_TR_WIDTH
    bytes). If there is no enough data in the DMA-channel internal FIFO for
    even a single non-burst transaction of CTLx.DST_TR_WIDTH bytes, then the
    channel enters "FIFO flush mode". That mode is activated to empty the FIFO
    and flush the leftovers out to the memory peripheral. The flushing
    procedure is simple.  The data is sent to the memory by means of a set of
    single transaction of CTLx.SRC_TR_WIDTH bytes. To sum up it's redundant to
    use the LLPs length to find out the CTLx.DST_TR_WIDTH parameter value,
    since each DMA transfer will be completed with the CTLx.SRC_TR_WIDTH bytes
    transaction if it is required.
    
    We suggest to remove the LLP entry length from the statement which
    calculates the memory peripheral DMA transaction width since it's
    redundant due to the feature described above. By doing so we'll improve
    the memory bus utilization and speed up the DMA-channel performance for
    DMA_DEV_TO_MEM DMA-transfers.
    Signed-off-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
    Acked-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://lore.kernel.org/r/20200731200826.9292-4-Sergey.Semin@baikalelectronics.ruSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    0ed725d1
core.c 33.7 KB