Merge "msm: ADSPRPC: Use msm_ion_do_cache_op to flush userspace buffers"
This commit is contained in:
commit
99956cfb73
1 changed files with 37 additions and 17 deletions
|
@ -1256,9 +1256,18 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
|
|||
if (map && (map->attr & FASTRPC_ATTR_COHERENT))
|
||||
continue;
|
||||
|
||||
if (rpra[i].buf.len && ctx->overps[oix]->mstart)
|
||||
if (rpra[i].buf.len && ctx->overps[oix]->mstart) {
|
||||
if (map && map->handle)
|
||||
msm_ion_do_cache_op(ctx->fl->apps->client,
|
||||
map->handle,
|
||||
uint64_to_ptr(rpra[i].buf.pv),
|
||||
rpra[i].buf.len,
|
||||
ION_IOC_CLEAN_INV_CACHES);
|
||||
else
|
||||
dmac_flush_range(uint64_to_ptr(rpra[i].buf.pv),
|
||||
uint64_to_ptr(rpra[i].buf.pv + rpra[i].buf.len));
|
||||
uint64_to_ptr(rpra[i].buf.pv
|
||||
+ rpra[i].buf.len));
|
||||
}
|
||||
}
|
||||
PERF_END);
|
||||
|
||||
|
@ -1269,11 +1278,6 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
|
|||
rpra[inh + i].h = ctx->lpra[inh + i].h;
|
||||
}
|
||||
|
||||
if (!ctx->fl->sctx->smmu.coherent) {
|
||||
PERF(ctx->fl->profile, ctx->fl->perf.flush,
|
||||
dmac_flush_range((char *)rpra, (char *)rpra + ctx->used);
|
||||
PERF_END);
|
||||
}
|
||||
bail:
|
||||
return err;
|
||||
}
|
||||
|
@ -1337,15 +1341,34 @@ static void inv_args_pre(struct smq_invoke_ctx *ctx)
|
|||
if (buf_page_start(ptr_to_uint64((void *)rpra)) ==
|
||||
buf_page_start(rpra[i].buf.pv))
|
||||
continue;
|
||||
if (!IS_CACHE_ALIGNED((uintptr_t)uint64_to_ptr(rpra[i].buf.pv)))
|
||||
dmac_flush_range(uint64_to_ptr(rpra[i].buf.pv),
|
||||
(char *)(uint64_to_ptr(rpra[i].buf.pv + 1)));
|
||||
if (!IS_CACHE_ALIGNED((uintptr_t)
|
||||
uint64_to_ptr(rpra[i].buf.pv))) {
|
||||
if (map && map->handle)
|
||||
msm_ion_do_cache_op(ctx->fl->apps->client,
|
||||
map->handle,
|
||||
uint64_to_ptr(rpra[i].buf.pv),
|
||||
sizeof(uintptr_t),
|
||||
ION_IOC_CLEAN_INV_CACHES);
|
||||
else
|
||||
dmac_flush_range(
|
||||
uint64_to_ptr(rpra[i].buf.pv), (char *)
|
||||
uint64_to_ptr(rpra[i].buf.pv + 1));
|
||||
}
|
||||
|
||||
end = (uintptr_t)uint64_to_ptr(rpra[i].buf.pv +
|
||||
rpra[i].buf.len);
|
||||
if (!IS_CACHE_ALIGNED(end))
|
||||
if (!IS_CACHE_ALIGNED(end)) {
|
||||
if (map && map->handle)
|
||||
msm_ion_do_cache_op(ctx->fl->apps->client,
|
||||
map->handle,
|
||||
uint64_to_ptr(end),
|
||||
sizeof(uintptr_t),
|
||||
ION_IOC_CLEAN_INV_CACHES);
|
||||
else
|
||||
dmac_flush_range((char *)end,
|
||||
(char *)end + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void inv_args(struct smq_invoke_ctx *ctx)
|
||||
|
@ -1353,7 +1376,6 @@ static void inv_args(struct smq_invoke_ctx *ctx)
|
|||
int i, inbufs, outbufs;
|
||||
uint32_t sc = ctx->sc;
|
||||
remote_arg64_t *rpra = ctx->rpra;
|
||||
int used = ctx->used;
|
||||
int inv = 0;
|
||||
|
||||
inbufs = REMOTE_SCALARS_INBUFS(sc);
|
||||
|
@ -1386,8 +1408,6 @@ static void inv_args(struct smq_invoke_ctx *ctx)
|
|||
+ rpra[i].buf.len));
|
||||
}
|
||||
|
||||
if (inv || REMOTE_SCALARS_OUTHANDLES(sc))
|
||||
dmac_inv_range(rpra, (char *)rpra + used);
|
||||
}
|
||||
|
||||
static int fastrpc_invoke_send(struct smq_invoke_ctx *ctx,
|
||||
|
|
Loading…
Add table
Reference in a new issue