All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Skidanov <alexey.skidanov@intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, labbott@redhat.com,
	tkjos@android.com, rve@android.com, linux-kernel@vger.kernel.org,
	maco@android.com, sumit.semwal@linaro.org
Subject: Re: [PATCH v3] staging: android: ion: Add implementation of dma_buf_vmap and dma_buf_vunmap
Date: Thu, 1 Feb 2018 08:10:07 +0200	[thread overview]
Message-ID: <89be45dd-ac0e-4efb-2b21-e6c07b0cd66e@intel.com> (raw)
In-Reply-To: <20180131130047.GA22917@kroah.com>


On 01/31/2018 03:00 PM, Greg KH wrote:
> 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@intel.com>
>> ---
> 
> No review from any other Intel developers? :(
Will add.
> 
> Anyway, what in-tree driver needs access to these functions?
I'm not sure that there are the in-tree drivers using these functions 
and ion as buffer exporter because they are not implemented in ion :) 
But there are some in-tree drivers using these APIs (gpu drivers) with 
other buffer exporters.
> 
> 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.
dma_buf_start_cpu_access is called before the call to dma_buf_vmap. It 
actually increments the reference count. dma_buf_end_cpu_access is 
called after the dma_buf_vunmap. It actually decrements the reference 
count.>>
>> 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)?
Sure.
> 
> Again, please get this reviewed by someone else in Intel first.  Don't
> ignore the resources you have, to do so would be foolish :)
Sure. Will do.
> 
> thanks,
> 
> greg k-h
> 

Thanks,
Alexey

  reply	other threads:[~2018-02-01  6:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 12:03 [PATCH v3] staging: android: ion: Add implementation of dma_buf_vmap and dma_buf_vunmap Alexey Skidanov
2018-01-31 13:00 ` Greg KH
2018-02-01  6:10   ` Alexey Skidanov [this message]
2018-02-06 23:56     ` Laura Abbott
2018-02-07  5:25       ` Alexey Skidanov
2018-12-16  5:20         ` Liam Mark
2018-12-16  6:35           ` Alexey Skidanov
2018-12-17 18:42             ` Liam Mark
2018-12-18 16:24               ` Alexey Skidanov
2019-01-04 17:41                 ` Liam Mark
2019-01-04 22:11                   ` Skidanov, Alexey
2019-01-29 23:56                     ` Liam Mark

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=89be45dd-ac0e-4efb-2b21-e6c07b0cd66e@intel.com \
    --to=alexey.skidanov@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=rve@android.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tkjos@android.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.