]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
dmaengine: dw: Discard dlen from the dev-to-mem xfer width calculation
authorSerge Semin <Sergey.Semin@baikalelectronics.ru>
Fri, 31 Jul 2020 20:08:24 +0000 (23:08 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 17 Aug 2020 06:28:31 +0000 (11:58 +0530)
commit0ed725d1f559b290a2fd12a9c689d946a7bef51d
treec41eeb71ef33ad8edd0b48a1bcc8c27588b4c5f9
parent6d9459d04081c796fc67c2bb771f4e4ebb5744c4
dmaengine: dw: Discard dlen from the dev-to-mem xfer width calculation

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: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200731200826.9292-4-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dw/core.c