[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180131130047.GA22917@kroah.com>
Date: Wed, 31 Jan 2018 14:00:47 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Alexey Skidanov <alexey.skidanov@...el.com>
Cc: devel@...verdev.osuosl.org, labbott@...hat.com, tkjos@...roid.com,
rve@...roid.com, linux-kernel@...r.kernel.org, maco@...roid.com,
sumit.semwal@...aro.org
Subject: Re: [PATCH v3] staging: android: ion: Add implementation of
dma_buf_vmap and dma_buf_vunmap
On Wed, Jan 31, 2018 at 02:03:42PM +0200, Alexey Skidanov wrote:
> Any driver may access shared buffers, created by ion, using dma_buf_vmap and
> dma_buf_vunmap dma-buf API that maps/unmaps previosuly allocated buffers into
> the kernel virtual address space. The implementation of these API is missing in
> the current ion implementation.
>
> Signed-off-by: Alexey Skidanov <alexey.skidanov@...el.com>
> ---
No review from any other Intel developers? :(
Anyway, what in-tree driver needs access to these functions?
And are you sure that you don't need to do any "real" logic in the
vmap/vunmap calls? That feels like there would be some reference
counting problems here.
> drivers/staging/android/ion/ion.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
> index f480885..4f1dc7f 100644
> --- a/drivers/staging/android/ion/ion.c
> +++ b/drivers/staging/android/ion/ion.c
> @@ -327,6 +327,17 @@ static void ion_dma_buf_kunmap(struct dma_buf *dmabuf, unsigned long offset,
> {
> }
>
> +static void *ion_dma_buf_vmap(struct dma_buf *dmabuf)
> +{
> + struct ion_buffer *buffer = dmabuf->priv;
> +
> + return buffer->vaddr;
Just call ion_dma_buf_kmap(dmabuf, 0)?
Again, please get this reviewed by someone else in Intel first. Don't
ignore the resources you have, to do so would be foolish :)
thanks,
greg k-h
Powered by blists - more mailing lists