ソースを参照

msm: adsprpc: correct the invocation of dma_buf_begin/end_cpu_access

In case of IO Coherence disabled, to simulate
cache clean and invalidate for output buffers,
used dma_buf_end_cpu_access(DMA_TO_DEVICE)
and dma_buf_begin_cpu_access(DMA_FROM_DEVICE).

Change-Id: Id176a26cb740d168a1a28240874434c626e48d75
Signed-off-by: DEEPAK SANNAPAREDDY <[email protected]>
DEEPAK SANNAPAREDDY 1 年間 前
コミット
9e7b2c7220
1 ファイル変更4 行追加4 行削除
  1. 4 4
      dsp/adsprpc.c

+ 4 - 4
dsp/adsprpc.c

@@ -2812,9 +2812,9 @@ static void inv_args(struct smq_invoke_ctx *ctx)
 				ctx->overps[i]->mstart)) == map->size) ||
 				ctx->overps[i]->do_cmo) {
 					dma_buf_begin_cpu_access(map->buf,
-						DMA_TO_DEVICE);
-					dma_buf_end_cpu_access(map->buf,
 						DMA_FROM_DEVICE);
+					dma_buf_end_cpu_access(map->buf,
+						DMA_TO_DEVICE);
 					ADSPRPC_DEBUG(
 						"sc 0x%x pv 0x%llx, mend 0x%llx mstart 0x%llx, len %zu size %zu\n",
 						sc, rpra[over].buf.pv,
@@ -2848,10 +2848,10 @@ static void inv_args(struct smq_invoke_ctx *ctx)
 					}
 					up_read(&current->mm->mmap_lock);
 					dma_buf_begin_cpu_access_partial(
-						map->buf, DMA_TO_DEVICE, offset,
+						map->buf, DMA_FROM_DEVICE, offset,
 						inv_len);
 					dma_buf_end_cpu_access_partial(map->buf,
-						DMA_FROM_DEVICE, offset,
+						DMA_TO_DEVICE, offset,
 						inv_len);
 					ADSPRPC_DEBUG(
 						"sc 0x%x vm_start 0x%llx pv 0x%llx, offset 0x%llx, mend 0x%llx mstart 0x%llx, len %zu size %zu\n",