iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Christoph Hellwig <hch@lst.de>, Tomasz Figa <tfiga@chromium.org>
Cc: Sergey Senozhatsky <senozhatsky@google.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	IOMMU DRIVERS <iommu@lists.linux-foundation.org>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API
Date: Wed, 9 Dec 2020 13:05:11 +0000	[thread overview]
Message-ID: <6b34596d-34c4-bd99-c5a7-5a4742c5b886@arm.com> (raw)
In-Reply-To: <20201209111235.GA22806@lst.de>

On 2020-12-09 11:12, Christoph Hellwig wrote:
> On Tue, Dec 08, 2020 at 01:54:00PM +0900, Tomasz Figa wrote:
>> >From the media perspective, it would be good to have the vmap
>> optional, similarly to the DMA_ATTR_NO_KERNEL_MAPPING attribute for
>> coherent allocations. Actually, in the media drivers, the need to have
>> a kernel mapping of the DMA buffers corresponds to a minority of the
>> drivers. Most of them only need to map them to the userspace.
>>
>> Nevertheless, that minority actually happens to be quite widely used,
>> e.g. the uvcvideo driver, so we can't go to the other extreme and just
>> drop the vmap at all.
> 
> My main problem is that the DMA_ATTR_NO_KERNEL_MAPPING makes a mess
> of an API.  I'd much rather have low-level API that returns the
> discontiguous allocations and another one that vmaps them rather
> than starting to overload arguments like in dma_alloc_attrs with
> DMA_ATTR_NO_KERNEL_MAPPING.

Agreed - if iommu-dma's dma_alloc_coherent() ends up as little more than 
a thin wrapper around those two functions I think that would be a good 
sign. It also seems like it might be a good idea for this API to use 
scatterlists rather than page arrays as it's fundamental format, to help 
reduce impedance with dma-buf - if we can end up with a wider redesign 
that also gets rid of dma_get_sgtable(), all the better!

Robin.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2020-12-09 13:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 22:19 [PATCH v3 5/6] media: uvcvideo: Use dma_alloc_noncontiguos API Ricardo Ribalda
2020-11-26 11:44 ` Sergey Senozhatsky
2020-11-30  8:31   ` Christoph Hellwig
2020-11-30  8:34 ` Christoph Hellwig
2020-11-30 10:49   ` Ricardo Ribalda
2020-12-01  3:36   ` Sergey Senozhatsky
2020-12-01 14:49     ` Christoph Hellwig
2020-12-08  4:54       ` Tomasz Figa
2020-12-08  6:45         ` Sergey Senozhatsky via iommu
2020-12-08  7:13         ` Sergey Senozhatsky
2020-12-09 11:16           ` . Christoph Hellwig
2021-01-07 14:14             ` Ricardo Ribalda
2021-01-11  8:36               ` . Christoph Hellwig
2021-01-15 13:08                 ` Ricardo Ribalda
2021-01-20 17:17                   ` . Christoph Hellwig
2021-01-26 17:06                   ` . Christoph Hellwig
2021-01-26 23:29                     ` Ricardo Ribalda
2021-01-27 15:56                       ` . Christoph Hellwig
2021-01-27 21:35                         ` Ricardo Ribalda
2021-01-28  7:57                           ` . Christoph Hellwig
2020-12-09 11:12         ` Christoph Hellwig
2020-12-09 13:05           ` Robin Murphy [this message]
2020-12-10  5:08             ` Tomasz Figa

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=6b34596d-34c4-bd99-c5a7-5a4742c5b886@arm.com \
    --to=robin.murphy@arm.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=senozhatsky@google.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=tfiga@chromium.org \
    /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).