From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
Tomasz Figa <tfiga@chromium.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Ricardo Ribalda <ribalda@chromium.org>,
Christoph Hellwig <hch@lst.de>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Collabora Kernel ML <kernel@collabora.com>
Subject: Re: [PATCHv3 8/8] videobuf2: handle non-contiguous DMA allocations
Date: Tue, 27 Jul 2021 16:06:39 +0900 [thread overview]
Message-ID: <YP+wf+G8V4AoXSBq@google.com> (raw)
In-Reply-To: <3c80786a-7422-3736-7261-8605260eb99f@collabora.com>
On (21/07/22 19:26), Dafna Hirschfeld wrote:
> > /*********************************************/
> > @@ -139,17 +175,63 @@ static void vb2_dc_put(void *buf_priv)
> > sg_free_table(buf->sgt_base);
> > kfree(buf->sgt_base);
> > }
> > - dma_free_attrs(buf->dev, buf->size, buf->cookie, buf->dma_addr,
> > - buf->attrs);
> > +
> > + if (buf->coherent_mem) {
> > + dma_free_attrs(buf->dev, buf->size, buf->cookie,
> > + buf->dma_addr, buf->attrs);
> > + } else {
> > + if (buf->vaddr)
> > + dma_vunmap_noncontiguous(buf->dev, buf->vaddr);
> > + dma_free_noncontiguous(buf->dev, buf->size,
> > + buf->dma_sgt, buf->dma_addr);
>
> The last argument for dma_free_noncontiguous should be dma_dir.
> Also, the 'cookie' cb returns buf->dma_addr which is not initialized for
> the noncontiguous api. So it is not clear how drivers should use the new api.
Done. Thank you Dafna.
prev parent reply other threads:[~2021-07-27 7:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-09 9:20 [PATCHv3 0/8] videobuf2: support new noncontiguous DMA API Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 1/8] videobuf2: rework vb2_mem_ops API Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 2/8] videobuf2: inverse buffer cache_hints flags Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 3/8] videobuf2: split buffer cache_hints initialisation Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 4/8] videobuf2: move cache_hints handling to allocators Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 5/8] videobuf2: add V4L2_MEMORY_FLAG_NON_COHERENT flag Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 6/8] videobuf2: add queue memory coherency parameter Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 7/8] videobuf2: handle V4L2_MEMORY_FLAG_NON_COHERENT flag Sergey Senozhatsky
2021-07-22 17:33 ` Dafna Hirschfeld
2021-07-26 1:40 ` Sergey Senozhatsky
2021-07-26 4:05 ` Sergey Senozhatsky
2021-07-26 4:20 ` Sergey Senozhatsky
2021-07-26 4:22 ` Tomasz Figa
2021-07-26 4:41 ` Sergey Senozhatsky
2021-07-09 9:20 ` [PATCHv3 8/8] videobuf2: handle non-contiguous DMA allocations Sergey Senozhatsky
2021-07-22 17:26 ` Dafna Hirschfeld
2021-07-26 3:59 ` Sergey Senozhatsky
2021-07-26 4:04 ` Tomasz Figa
2021-07-26 4:10 ` Sergey Senozhatsky
2021-07-27 7:06 ` Sergey Senozhatsky [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=YP+wf+G8V4AoXSBq@google.com \
--to=senozhatsky@chromium.org \
--cc=dafna.hirschfeld@collabora.com \
--cc=hch@lst.de \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ribalda@chromium.org \
--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).