Skip to contentSkip to conversation

drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y

PATCH In review Qiang Yu 2 participants 2 messages Oct 31, 2021

Subsystems (3)
lore
Share & tools
lore

Qiang Yu

author maintainer
#0 lore raw

PATCH 1/1 drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y

Otherwise get following warning:

DMA-API: lima 1c40000.gpu: mapping sg segment longer than device claims to support [len=4149248] [max=65536]

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5496

---
 drivers/gpu/drm/lima/lima_device.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/lima/lima_device.c +1 -0
index 65fdca366e41..36c990589427 100644
@@ -357,6 +357,7 @@ int lima_device_init(struct lima_device *ldev)
 	int err, i;
 
 	dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+	dma_set_max_seg_size(ldev->dev, UINT_MAX);
 
 	err = lima_clk_init(ldev);
 	if (err)
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Qiang Yu

Otherwise get following warning:

DMA-API: lima 1c40000.gpu: mapping sg segment longer than device claims to support [len=4149248] [max=65536]

See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5496

Quoted 20 lines
---
 drivers/gpu/drm/lima/lima_device.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/lima/lima_device.c +1 -1
index 65fdca366e41..36c990589427 100644
@@ -357,6 +357,7 @@ int lima_device_init(struct lima_device *ldev)
        int err, i;
 
        dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
+       dma_set_max_seg_size(ldev->dev, UINT_MAX);
 
        err = lima_clk_init(ldev);
        if (err)
--

2.25.1