Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: dw: Set DMA device max segment size parameter

Maximum block size DW DMAC configuration corresponds to the max segment
size DMA parameter in the DMA core subsystem notation. Lets set it with a
value specific to the probed DW DMA controller. It shall help the DMA
clients to create size-optimized SG-list items for the controller. This in
turn will cause less dw_desc allocations, less LLP reinitializations,
better DMA device performance.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200723005848.31907-8-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Serge Semin and committed by
Vinod Koul
e6fe5767 ef3e515a

+7
+7
drivers/dma/dw/core.c
··· 1229 1229 BIT(DMA_MEM_TO_MEM); 1230 1230 dw->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; 1231 1231 1232 + /* 1233 + * For now there is no hardware with non uniform maximum block size 1234 + * across all of the device channels, so we set the maximum segment 1235 + * size as the block size found for the very first channel. 1236 + */ 1237 + dma_set_max_seg_size(dw->dma.dev, dw->chan[0].block_size); 1238 + 1232 1239 err = dma_async_device_register(&dw->dma); 1233 1240 if (err) 1234 1241 goto err_dma_register;