Loading drivers/char/adsprpc.c +26 −3 Original line number Diff line number Diff line Loading @@ -572,6 +572,13 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, goto bail; if (sess->smmu.enabled) { attrs = DMA_ATTR_EXEC_MAPPING; if (map->attr & FASTRPC_ATTR_NON_COHERENT || (sess->smmu.coherent && map->uncached)) attrs |= DMA_ATTR_FORCE_NON_COHERENT; else if (map->attr & FASTRPC_ATTR_COHERENT) attrs |= DMA_ATTR_FORCE_COHERENT; VERIFY(err, map->table->nents == msm_dma_map_sg_attrs(sess->dev, map->table->sgl, map->table->nents, Loading Loading @@ -1121,7 +1128,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx) for (i = 0; i < M_FDLIST; i++) fdlist[i] = 0; crclist = (uint32_t *)&fdlist[M_FDLIST]; memset(crclist, 0, sizeof(uint32_t)*M_FDLIST); memset(crclist, 0, sizeof(uint32_t)*M_CRCLIST); /* copy non ion buffers */ PERF(ctx->fl->profile, ctx->fl->perf.copy, Loading Loading @@ -1169,10 +1176,14 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx) int i = ctx->overps[oix]->raix; struct fastrpc_mmap *map = ctx->maps[i]; if (ctx->fl->sctx->smmu.coherent) continue; if (map && map->uncached) continue; if (ctx->fl->sctx->smmu.coherent && !(map && (map->attr & FASTRPC_ATTR_NON_COHERENT))) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; if (rpra[i].buf.len && ctx->overps[oix]->mstart) dmac_flush_range(uint64_to_ptr(rpra[i].buf.pv), uint64_to_ptr(rpra[i].buf.pv + rpra[i].buf.len)); Loading Loading @@ -1261,6 +1272,12 @@ static void inv_args_pre(struct smq_invoke_ctx *ctx) continue; if (!rpra[i].buf.len) continue; if (ctx->fl->sctx->smmu.coherent && !(map && (map->attr & FASTRPC_ATTR_NON_COHERENT))) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; if (buf_page_start(ptr_to_uint64((void *)rpra)) == buf_page_start(rpra[i].buf.pv)) continue; Loading Loading @@ -1291,6 +1308,12 @@ static void inv_args(struct smq_invoke_ctx *ctx) continue; if (!rpra[i].buf.len) continue; if (ctx->fl->sctx->smmu.coherent && !(map && (map->attr & FASTRPC_ATTR_NON_COHERENT))) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; if (buf_page_start(ptr_to_uint64((void *)rpra)) == buf_page_start(rpra[i].buf.pv)) { continue; Loading drivers/char/adsprpc_shared.h +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ /* Set for buffers that have no virtual mapping in userspace */ #define FASTRPC_ATTR_NOVA 0x1 /* Set for buffers that are NOT dma coherent */ #define FASTRPC_ATTR_NON_COHERENT 0x2 /* Set for buffers that are dma coherent */ #define FASTRPC_ATTR_COHERENT 0x4 /* Driver should operate in parallel with the co-processor */ #define FASTRPC_MODE_PARALLEL 0 Loading Loading
drivers/char/adsprpc.c +26 −3 Original line number Diff line number Diff line Loading @@ -572,6 +572,13 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, goto bail; if (sess->smmu.enabled) { attrs = DMA_ATTR_EXEC_MAPPING; if (map->attr & FASTRPC_ATTR_NON_COHERENT || (sess->smmu.coherent && map->uncached)) attrs |= DMA_ATTR_FORCE_NON_COHERENT; else if (map->attr & FASTRPC_ATTR_COHERENT) attrs |= DMA_ATTR_FORCE_COHERENT; VERIFY(err, map->table->nents == msm_dma_map_sg_attrs(sess->dev, map->table->sgl, map->table->nents, Loading Loading @@ -1121,7 +1128,7 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx) for (i = 0; i < M_FDLIST; i++) fdlist[i] = 0; crclist = (uint32_t *)&fdlist[M_FDLIST]; memset(crclist, 0, sizeof(uint32_t)*M_FDLIST); memset(crclist, 0, sizeof(uint32_t)*M_CRCLIST); /* copy non ion buffers */ PERF(ctx->fl->profile, ctx->fl->perf.copy, Loading Loading @@ -1169,10 +1176,14 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx) int i = ctx->overps[oix]->raix; struct fastrpc_mmap *map = ctx->maps[i]; if (ctx->fl->sctx->smmu.coherent) continue; if (map && map->uncached) continue; if (ctx->fl->sctx->smmu.coherent && !(map && (map->attr & FASTRPC_ATTR_NON_COHERENT))) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; if (rpra[i].buf.len && ctx->overps[oix]->mstart) dmac_flush_range(uint64_to_ptr(rpra[i].buf.pv), uint64_to_ptr(rpra[i].buf.pv + rpra[i].buf.len)); Loading Loading @@ -1261,6 +1272,12 @@ static void inv_args_pre(struct smq_invoke_ctx *ctx) continue; if (!rpra[i].buf.len) continue; if (ctx->fl->sctx->smmu.coherent && !(map && (map->attr & FASTRPC_ATTR_NON_COHERENT))) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; if (buf_page_start(ptr_to_uint64((void *)rpra)) == buf_page_start(rpra[i].buf.pv)) continue; Loading Loading @@ -1291,6 +1308,12 @@ static void inv_args(struct smq_invoke_ctx *ctx) continue; if (!rpra[i].buf.len) continue; if (ctx->fl->sctx->smmu.coherent && !(map && (map->attr & FASTRPC_ATTR_NON_COHERENT))) continue; if (map && (map->attr & FASTRPC_ATTR_COHERENT)) continue; if (buf_page_start(ptr_to_uint64((void *)rpra)) == buf_page_start(rpra[i].buf.pv)) { continue; Loading
drivers/char/adsprpc_shared.h +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,12 @@ /* Set for buffers that have no virtual mapping in userspace */ #define FASTRPC_ATTR_NOVA 0x1 /* Set for buffers that are NOT dma coherent */ #define FASTRPC_ATTR_NON_COHERENT 0x2 /* Set for buffers that are dma coherent */ #define FASTRPC_ATTR_COHERENT 0x4 /* Driver should operate in parallel with the co-processor */ #define FASTRPC_MODE_PARALLEL 0 Loading