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:
Jianqun Xu
2021-08-04 09:13:57 +08:00
committed by Tao Huang
parent ea0a51bb9d
commit bfce6910d4

View File

@@ -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;