linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Robin Murphy <robin.murphy@arm.com>
Cc: Christoph Hellwig <hch@lst.de>, Tomasz Figa <tfiga@chromium.org>,
	Fang Hui <hui.fang@nxp.com>,
	m.szyprowski@samsung.com, mchehab@kernel.org,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	anle.pan@nxp.com, xuegang.liu@nxp.com
Subject: Re: [PATCH] MA-21654 Use dma_alloc_pages in vb2_dma_sg_alloc_compacted
Date: Tue, 26 Sep 2023 11:46:16 +0200	[thread overview]
Message-ID: <20230926094616.GA14877@lst.de> (raw)
In-Reply-To: <4d0f3de5-1d34-d998-cb55-7ce7bfaf3f49@arm.com>

On Tue, Sep 26, 2023 at 09:21:15AM +0100, Robin Murphy wrote:
> On 2023-09-26 07:51, Christoph Hellwig wrote:
>> On Wed, Sep 20, 2023 at 05:54:26PM +0100, Robin Murphy wrote:
>>> As I mentioned before, I think it might make the most sense to make the
>>> whole thing into a "proper" dma_alloc_sgtable() function, which can then be
>>> used with dma_sync_sgtable_*() as dma_alloc_pages() is used with
>>> dma_sync_single_*() (and then dma_alloc_noncontiguous() clearly falls as
>>> the special in-between case).
>>
>> Why not just use dma_alloc_noncontiguous if the caller wants an sgtable
>> anyway?
>
> Because we don't need the restriction of the allocation being 
> DMA-contiguous (and thus having to fall back to physically-contiguous in 
> the absence of an IOMMU). That's what vb2_dma_contig already does, whereas 
> IIUC vb2_dma_sg is for devices which can handle genuine scatter-gather DMA 
> (and so are less likely to have an IOMMU, and more likely to need the best 
> shot at piecing together large allocations).

Let's just extent dma_alloc_noncontiguous with a max_dma_segments
parameter instead of adding yet another API.


  reply	other threads:[~2023-09-26  9:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 14:58 [PATCH] MA-21654 Use dma_alloc_pages in vb2_dma_sg_alloc_compacted Fang Hui
2023-09-14  7:52 ` Hui Fang
2023-09-18  2:20   ` Hui Fang
2023-09-18  7:07   ` Hui Fang
2023-09-18 23:43 ` kernel test robot
2023-09-19  6:43   ` [EXT] " Hui Fang
2023-09-19 19:04     ` Nicolas Dufresne
2023-09-20  7:41 ` Tomasz Figa
2023-09-20 10:02   ` [EXT] " Hui Fang
2023-09-20 16:54   ` Robin Murphy
2023-09-21  8:35     ` Tomasz Figa
2023-09-26  6:51     ` Christoph Hellwig
2023-09-26  8:21       ` Robin Murphy
2023-09-26  9:46         ` Christoph Hellwig [this message]
2023-09-26 14:38           ` Robin Murphy
2023-12-28  7:46             ` Tomasz Figa
2024-05-13  9:49               ` [EXT] " Hui Fang
2024-05-21  0:35                 ` Tomasz Figa
2023-09-26  6:50   ` Christoph Hellwig

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=20230926094616.GA14877@lst.de \
    --to=hch@lst.de \
    --cc=anle.pan@nxp.com \
    --cc=hui.fang@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tfiga@chromium.org \
    --cc=xuegang.liu@nxp.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;
as well as URLs for NNTP newsgroup(s).