video: rockchip: rga3: fix iommu device sync cache causing crash

When the iommu device calls the dma_sync_single_xx API, it will be
regarded as being called through iova by default, so the physical
address obtained will be invalid.

Update driver version to 1.3.1

Change-Id: I0a2c8fcecd556eccee499e06f41d790043f1fa0d
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
This commit is contained in:
Yu Qiaowei
2023-11-09 17:37:19 +08:00
committed by Tao Huang
parent c4efb37476
commit 9384a8ec90
2 changed files with 5 additions and 3 deletions

View File

@@ -87,7 +87,7 @@
#define DRIVER_MAJOR_VERISON 1
#define DRIVER_MINOR_VERSION 3
#define DRIVER_REVISION_VERSION 0
#define DRIVER_REVISION_VERSION 1
#define DRIVER_PATCH_VERSION
#define DRIVER_VERSION (STR(DRIVER_MAJOR_VERISON) "." STR(DRIVER_MINOR_VERSION) \

View File

@@ -1319,7 +1319,8 @@ static int rga_mm_sync_dma_sg_for_device(struct rga_internal_buffer *buffer,
return -EFAULT;
}
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS) {
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS &&
scheduler->data->mmu != RGA_IOMMU) {
dma_sync_single_for_device(scheduler->dev, buffer->phys_addr, buffer->size, dir);
} else {
sgt = rga_mm_lookup_sgt(buffer);
@@ -1349,7 +1350,8 @@ static int rga_mm_sync_dma_sg_for_cpu(struct rga_internal_buffer *buffer,
return -EFAULT;
}
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS) {
if (buffer->mm_flag & RGA_MEM_PHYSICAL_CONTIGUOUS &&
scheduler->data->mmu != RGA_IOMMU) {
dma_sync_single_for_cpu(scheduler->dev, buffer->phys_addr, buffer->size, dir);
} else {
sgt = rga_mm_lookup_sgt(buffer);