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

dmaengine: stm32-dma: set dma_device max_sg_burst

Some stm32-dma consumers [1] rather use dma_get_slave_caps() to get
max_sg_burst of their DMA channel as dma_get_max_seg_size() is specific to
the DMA controller.
All stm32-dma channels have the same features so, don't need to implement
device_caps ops. Let dma_get_slave_caps() relies on dma_device
configuration.
That's why this patch sets dma_device max_sg_burst to the maximum segment
size, which is the maximum of data items that can be transferred without
software intervention.

[1] https://lore.kernel.org/lkml/20220110103739.118426-1-alain.volmat@foss.st.com/
"media: stm32: dcmi: create a dma scatterlist based on DMA max_sg_burst value"

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Tested-by: Alain Volmat <alain.volmat@foss.st.com>
Link: https://lore.kernel.org/r/20220117091740.11064-1-amelie.delaunay@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Amelie Delaunay and committed by
Vinod Koul
728f6c78 177360e0

+1
+1
drivers/dma/stm32-dma.c
··· 1389 1389 dd->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; 1390 1390 dd->copy_align = DMAENGINE_ALIGN_32_BYTES; 1391 1391 dd->max_burst = STM32_DMA_MAX_BURST; 1392 + dd->max_sg_burst = STM32_DMA_ALIGNED_MAX_DATA_ITEMS; 1392 1393 dd->descriptor_reuse = true; 1393 1394 dd->dev = &pdev->dev; 1394 1395 INIT_LIST_HEAD(&dd->channels);