linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2 8/8] videobuf2: handle non-contiguous DMA allocations
Date: Thu, 17 Jun 2021 17:30:11 +0900	[thread overview]
Message-ID: <CAAFQd5DiPstn-s+yQM3iMd=G9oaag39qCyX483a7-Jrn=gxWCA@mail.gmail.com> (raw)
In-Reply-To: <20210617080107.GA1422@lst.de>

On Thu, Jun 17, 2021 at 5:01 PM Christoph Hellwig <hch@lst.de> wrote:
>
> On Thu, Jun 17, 2021 at 04:56:17PM +0900, Sergey Senozhatsky wrote:
> > > This function can use some comments. What is happening AFAICS is that
> > > buf->vaddr is either set in vb2_dc_alloc_coherent (unless
> > > DMA_ATTR_NO_KERNEL_MAPPING was set), it is obtained through dma_buf_vmap()
> > > if the buffer was attached to a dma_buf, or it is allocated via
> > > dma_vmap_noncontiguous() for non-coherent memory.
> >
> > Yeah, it's complicated. Maybe we can make things more symmetrical.
> >
> > > But this leaves coherent memory with DMA_ATTR_NO_KERNEL_MAPPING set, what
> > > is vaddr in that case? I think it will call dma_vmap_noncontiguous()
> > > incorrectly in that case, shouldn't there be a check for !buf->coherent_mem
> > > before the call to dma_vmap_noncontiguous()?
> >
> > Thanks a lot for looking into it.
>
> Can we just kill off DMA_ATTR_NO_KERNEL_MAPPING in v4l now?  There really is
> no good reason to use that with dma_alloc_noncoherent/noncontiguous
> available, and I plan to eventually remove that interface entirely.

We still have use cases for dma_alloc_coherent() and DMA_ATTR_NO_KERNEL_MAPPING.

Perhaps the way to handle this would be to make the
dma_alloc_coherent() behave the same way as dma_alloc_noncontiguous(),
where it just allocates the memory without handling the kernel
mapping?

Best regards,
Tomasz

  reply	other threads:[~2021-06-17  8:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 13:13 [PATCHv2 0/8] videobuf2: support new noncontiguous DMA API Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 1/8] videobuf2: rework vb2_mem_ops API Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 2/8] videobuf2: inverse buffer cache_hints flags Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 3/8] videobuf2: split buffer cache_hints initialisation Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 4/8] videobuf2: move cache_hints handling to allocators Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 5/8] videobuf2: add V4L2_MEMORY_FLAG_NON_COHERENT flag Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 6/8] videobuf2: add queue memory coherency parameter Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 7/8] videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag Sergey Senozhatsky
2021-05-01  3:48   ` Sergey Senozhatsky
2021-06-03 11:32   ` Hans Verkuil
2021-06-17  1:46     ` Sergey Senozhatsky
2021-04-27 13:13 ` [PATCHv2 8/8] videobuf2: handle non-contiguous DMA allocations Sergey Senozhatsky
2021-04-28  6:14   ` Christoph Hellwig
2021-06-03 11:59   ` Hans Verkuil
2021-06-17  7:56     ` Sergey Senozhatsky
2021-06-17  8:01       ` Christoph Hellwig
2021-06-17  8:30         ` Tomasz Figa [this message]
2021-06-17  8:52           ` Christoph Hellwig
2021-06-17  9:40             ` Tomasz Figa
2021-06-17 10:06               ` Christoph Hellwig
2021-06-18  3:21                 ` Tomasz Figa
2021-06-18  4:25                   ` Christoph Hellwig
2021-06-18  4:44                     ` Tomasz Figa
2021-06-22  7:33                       ` Christoph Hellwig
2021-07-07 12:42                         ` Tomasz Figa
2021-06-25  3:10       ` Sergey Senozhatsky
2021-07-07 12:48         ` Tomasz Figa
2021-07-07 13:29           ` Sergey Senozhatsky
2021-07-07 14:10             ` Tomasz Figa
2021-07-09  7:20               ` Sergey Senozhatsky
2021-06-17  7:56     ` Sergey Senozhatsky

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='CAAFQd5DiPstn-s+yQM3iMd=G9oaag39qCyX483a7-Jrn=gxWCA@mail.gmail.com' \
    --to=tfiga@chromium.org \
    --cc=hch@lst.de \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=senozhatsky@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).