mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Zenghui Yu <zenghui.yu@linux.dev>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: airlied@gmail.com, simona@ffwll.ch,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org
Subject: Re: [report] DMA-API: platform vgem: mapping sg segment longer than device claims to support [len=1048576] [max=65536]
Date: Wed, 18 Jun 2025 18:25:58 +0200	[thread overview]
Message-ID: <17d14458-a035-4793-8f19-38f4405e02a3@suse.de> (raw)
In-Reply-To: <6d22bce3-4533-4cfa-96ba-64352b715741@linux.dev>

Hi

Am 18.06.25 um 18:03 schrieb Zenghui Yu:
> Hi all,
>
> Running the dmabuf-heap test [*] on mainline kernel triggers the
> following splat:
>
>   ------------[ cut here ]------------
>   DMA-API: platform vgem: mapping sg segment longer than device claims to
> support [len=1048576] [max=65536]

Thanks for the bug report. We have a possible fix in the latest 
drm-misc-next tree. Does it work if use replace DRM_GEM_SHMEM_DRIVER_OPS 
with DRM_GEM_SHMEM_DRIVER_OPS_NO_MAP_SGT at [1]?

[1] 
https://elixir.bootlin.com/linux/v6.16-rc2/source/drivers/gpu/drm/vgem/vgem_drv.c#L118

Best regards
Thomas

>   WARNING: CPU: 7 PID: 1126 at kernel/dma/debug.c:1174
> debug_dma_map_sg+0x348/0x3e4
>   Modules linked in: vgem drm_shmem_helper drm_kms_helper rfkill drm fuse
> backlight sha3_ce sha512_ce ipv6
>   CPU: 7 UID: 0 PID: 1126 Comm: dmabuf-heap Kdump: loaded Not tainted
> 6.16.0-rc2-00024-g9afe652958c3-dirty PREEMPT
>   Hardware name: QEMU QEMU Virtual Machine, BIOS
> edk2-stable202408-prebuilt.qemu.org 08/13/2024
>   pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
>   pc : debug_dma_map_sg+0x348/0x3e4
>   lr : debug_dma_map_sg+0x348/0x3e4
>   sp : ffff800084313a50
>   x29: ffff800084313a50 x28: ffff0000c0a62480 x27: 0000000000000001
>   x26: ffffffffffffffff x25: 0000000000000000 x24: ffff0000c0985f20
>   x23: ffff8000815ab058 x22: 0000000000000001 x21: 0000000000000001
>   x20: 0000000000000000 x19: ffff0000c2797010 x18: 0000000000000020
>   x17: 0000000000000000 x16: 0000000000000000 x15: 00000000ffffffff
>   x14: ffff8000815c6390 x13: 00000000000005bb x12: 00000000000001e9
>   x11: fffffffffffe8360 x10: ffff80008161e390 x9 : 00000000fffff000
>   x8 : ffff8000815c6390 x7 : ffff80008161e390 x6 : 0000000000000000
>   x5 : ffff0001fee21308 x4 : 0000000000000001 x3 : 0000000000000000
>   x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000c5ea4600
>   Call trace:
>    debug_dma_map_sg+0x348/0x3e4 (P)
>    __dma_map_sg_attrs+0xbc/0x118
>    dma_map_sgtable+0x28/0x44
>    system_heap_map_dma_buf+0x2c/0x64
>    dma_buf_map_attachment+0x60/0x184
>    dma_buf_map_attachment_unlocked+0x3c/0x7c
>    drm_gem_prime_import_dev.part.0+0x58/0x130 [drm]
>    drm_gem_prime_import+0x48/0xc4 [drm]
>    drm_gem_prime_fd_to_handle+0x180/0x220 [drm]
>    drm_prime_fd_to_handle_ioctl+0x38/0x44 [drm]
>    drm_ioctl_kernel+0xb8/0x12c [drm]
>    drm_ioctl+0x204/0x4ec [drm]
>    __arm64_sys_ioctl+0xac/0x104
>    invoke_syscall+0x48/0x110
>    el0_svc_common.constprop.0+0x40/0xe0
>    do_el0_svc+0x1c/0x28
>    el0_svc+0x34/0x108
>    el0t_64_sync_handler+0xc8/0xcc
>    el0t_64_sync+0x198/0x19c
>   ---[ end trace 0000000000000000 ]---
>
> The kernel is built with arm64's virtconfig and
>
> +CONFIG_DMABUF_HEAPS=y
> +CONFIG_DMABUF_HEAPS_SYSTEM=y
> +CONFIG_DRM_VGEM=m
> +CONFIG_DMA_API_DEBUG=y
>
> [*] linux/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
>
> Thanks,
> Zenghui

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


  reply	other threads:[~2025-06-18 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18 16:03 Zenghui Yu
2025-06-18 16:25 ` Thomas Zimmermann [this message]
2025-06-19 16:07   ` Zenghui Yu
2025-06-20  5:17     ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17d14458-a035-4793-8f19-38f4405e02a3@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=zenghui.yu@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®