Skip to content

Commit e6fe576

Browse files
fancervinodkoul
authored andcommitted
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent ef3e515 commit e6fe576

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/dma/dw/core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,13 @@ int do_dma_probe(struct dw_dma_chip *chip)
12291229
BIT(DMA_MEM_TO_MEM);
12301230
dw->dma.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
12311231

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+
12321239
err = dma_async_device_register(&dw->dma);
12331240
if (err)
12341241
goto err_dma_register;

0 commit comments

Comments
 (0)