mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
staging: ion: bypass for start cpu access if dir is DMA_TO_DEVICE
From the final function ENTRY(__dma_unmap_area) cmp w2, #DMA_TO_DEVICE b.ne __dma_inv_area ret ENDPIPROC(__dma_unmap_area) if the direction isn't DMA_TO_DEVICE, it will do __dma_inv_area. So directly return if the dir is DMA_TO_DEVICE. Change-Id: I9ec2affddb8efb431a165100d78afca7fe6b2a45 Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
@@ -485,6 +485,9 @@ static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
|
||||
mutex_unlock(&buffer->lock);
|
||||
}
|
||||
|
||||
if (direction == DMA_TO_DEVICE)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&buffer->lock);
|
||||
if (IS_ENABLED(CONFIG_ION_FORCE_DMA_SYNC)) {
|
||||
struct device *dev = ion_dev;
|
||||
@@ -555,6 +558,9 @@ static int ion_dma_buf_begin_cpu_access_partial(struct dma_buf *dmabuf,
|
||||
struct ion_dma_buf_attachment *a;
|
||||
int ret = 0;
|
||||
|
||||
if (direction == DMA_TO_DEVICE)
|
||||
return 0;
|
||||
|
||||
mutex_lock(&buffer->lock);
|
||||
if (IS_ENABLED(CONFIG_ION_FORCE_DMA_SYNC)) {
|
||||
struct device *dev = ion_dev;
|
||||
|
||||
Reference in New Issue
Block a user