the kernel occasionally reports a segment size mismatch.
This is because 'max_seg_size' is not set. The kernel
defaults to 64K. Based on IOMMU addressing capabilities,
setting 'max_seg_size' to the maximum will prevent
'debug_dma_map_sg()' from complaining about the over-mapping
of the IOMMU segment length.

DMA-API: bcm2712-iommu 1000005100.iommu: mapping sg segment longer than device 
claims to support [len=2105344] [max=65536]
 WARNING: CPU: 0 PID: 59 at /kernel/dma/debug.c:1178 
check_sg_segment+0x190/0x200
 Modules linked in:
 CPU: 0 UID: 0 PID: 59 Comm: kworker/u16:1 Tainted: G        W          
6.12.55-rt6-yocto-preempt-rt #1
 Call trace:
  check_sg_segment+0x190/0x200
  debug_dma_map_sg+0x13c/0x1b0
  dma_alloc_noncontiguous+0x98/0x118
  bcm2712_iommu_probe+0x15c/0x320
  platform_probe+0x70/0xe8

Signed-off-by: Xiaolei Wang <[email protected]>
---
 drivers/iommu/bcm2712-iommu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/bcm2712-iommu.c b/drivers/iommu/bcm2712-iommu.c
index 4e6aa0352f5a..a9ae51d593ca 100644
--- a/drivers/iommu/bcm2712-iommu.c
+++ b/drivers/iommu/bcm2712-iommu.c
@@ -607,6 +607,7 @@ static int bcm2712_iommu_probe(struct platform_device *pdev)
         */
        ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(36));
        WARN_ON(ret);
+       dma_set_max_seg_size(&pdev->dev, UINT_MAX);
        mmu->sgt = dma_alloc_noncontiguous(&pdev->dev, TABLES_ALLOC_SIZE,
                                           DMA_TO_DEVICE, GFP_KERNEL,
                                           DMA_ATTR_ALLOC_SINGLE_PAGES);
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15974): 
https://lists.yoctoproject.org/g/linux-yocto/message/15974
Mute This Topic: https://lists.yoctoproject.org/mt/116271953/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

  • [linux-yocto][linux-yocto v6.12/... Xiaolei Wang via lists.yoctoproject.org

Reply via email to