From: Karl Mehltretter <kmehltretter@gmail.com>
To: "Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Brian Starkey <Brian.Starkey@arm.com>,
John Stultz <jstultz@google.com>,
"T . J . Mercier" <tjmercier@google.com>,
Jason Gunthorpe <jgg@nvidia.com>,
Dmitry Osipenko <digetx@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Russell King <linux@armlinux.org.uk>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linaro-mm-sig@lists.linaro.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] dma-buf: heaps: cma: respect the importer's maximum segment size
Date: Mon, 5 Oct 2026 08:46:37 +0200 [thread overview]
Message-ID: <20261005064640.7776-1-kmehltretter@gmail.com> (raw)
The CMA heap builds attachment scatterlists without considering the
importing device's maximum DMA segment size. When an entry exceeds
that limit, DMA_API_DEBUG reports "mapping sg segment longer than
device claims to support". Patch 3 uses the importer's limit. A
corresponding udmabuf fix was posted in [1].
With patch 3, an importer that keeps the 64 KiB default gets a larger
buffer in several entries. Two in-tree importers require a single
entry and never set a limit: tegra-vde without an IOMMU domain, and
armada. Patches 1 and 2 set an unlimited segment size there. I found
them by searching the importers for checks on the number of entries
and on the length of the first entry. etnaviv has a fast path for
single-entry buffers but already declares a 2 GiB limit.
Patches 1 and 2 are valid on their own and can go through their own
trees. Patch 3 should only be applied after them, and is marked
stable+noautosel for that reason.
Tested in QEMU only, not on real hardware: patch 3 on a custom model
of the SAM9X75 Curiosity, and all three patches on xilinx-zynq-a9
with tegra-vde and armada probing from stub device tree nodes. The
notes of each patch have the details.
[1] https://lore.kernel.org/r/20260929054835.94118-1-kmehltretter@gmail.com/
Karl Mehltretter (3):
media: tegra-vde: set an unlimited DMA segment size
drm/armada: set an unlimited DMA segment size
dma-buf: heaps: cma: respect the device's maximum segment size
drivers/dma-buf/heaps/cma_heap.c | 14 ++++++++++----
drivers/gpu/drm/armada/armada_drv.c | 3 +++
drivers/media/platform/nvidia/tegra-vde/vde.c | 2 ++
3 files changed, 15 insertions(+), 4 deletions(-)
base-commit: fe2ec83746e501645709761605c2464a44fd2929
--
2.53.0
next reply other threads:[~2026-10-05 6:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 6:46 Karl Mehltretter [this message]
2026-10-05 6:46 ` [PATCH 1/3] media: tegra-vde: set an unlimited DMA " Karl Mehltretter
2026-10-05 6:46 ` [PATCH 2/3] drm/armada: " Karl Mehltretter
2026-10-05 6:46 ` [PATCH 3/3] dma-buf: heaps: cma: respect the device's maximum " Karl Mehltretter
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=20261005064640.7776-1-kmehltretter@gmail.com \
--to=kmehltretter@gmail.com \
--cc=Brian.Starkey@arm.com \
--cc=airlied@gmail.com \
--cc=benjamin.gaignard@collabora.com \
--cc=christian.koenig@amd.com \
--cc=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jgg@nvidia.com \
--cc=jonathanh@nvidia.com \
--cc=jstultz@google.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mchehab@kernel.org \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=thierry.reding@kernel.org \
--cc=tjmercier@google.com \
/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®