mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Vivek Kasireddy <vivek.kasireddy@intel.com>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] udmabuf: respect the device's maximum segment size
Date: Tue, 29 Sep 2026 14:08:45 +0200	[thread overview]
Message-ID: <7b54a4ef-600f-4e10-af1e-16790207b74a@amd.com> (raw)
In-Reply-To: <20260928125853.GG163130@ziepe.ca>

On 9/28/26 14:58, Jason Gunthorpe wrote:
> On Mon, Sep 28, 2026 at 10:27:32AM +0200, Christian König wrote:
> 
>> In general I think that the sg_alloc_table_from_pages_segment()
>> approach is because of the broken design of the old DMA API.
> 
> The scatterlist and the DMA API use of it is very specialized to serve
> the needs of the storage stack without performance cost. Segmentation
> is intended to make the sgl entries map 1:1 to HW entries so the block
> layer can schedule correctly.

Yeah and that is a clear violation of the principle that kernel APIs shouldn't be designed with the use case in mind.

Instead the API should reflect what the HW does and needs, e.g. in this case what the bus systems and IOMMU engines can or can't do.

How it is used in the end should be irrelevant to that, it only servers as validation if the design fulfills all requirements or not.

Regards,
Christian.

> 
> Nothing else needs something like this but still has to tip toe around
> these rules. It makes it more complicated to map and then in some
> cases you have to undo it when programming HW :\
> 
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> 
> Jason


      reply	other threads:[~2026-09-29 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26  7:12 Karl Mehltretter
2026-09-28  8:27 ` Christian König
2026-09-28 12:58   ` Jason Gunthorpe
2026-09-29 12:08     ` Christian König [this message]

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=7b54a4ef-600f-4e10-af1e-16790207b74a@amd.com \
    --to=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jgg@ziepe.ca \
    --cc=kmehltretter@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=vivek.kasireddy@intel.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®