Loading drivers/char/adsprpc.c +10 −4 Original line number Diff line number Diff line Loading @@ -308,6 +308,7 @@ struct fastrpc_apps { spinlock_t ctxlock; struct smq_invoke_ctx *ctxtable[FASTRPC_CTX_MAX]; bool legacy_remote_heap; int in_hib; }; struct fastrpc_mmap { Loading Loading @@ -501,6 +502,7 @@ static void fastrpc_buf_free(struct fastrpc_buf *buf, int cache) { struct fastrpc_file *fl = buf == NULL ? NULL : buf->fl; int vmid; struct fastrpc_apps *me = &gfa; if (!fl) return; Loading @@ -524,7 +526,7 @@ static void fastrpc_buf_free(struct fastrpc_buf *buf, int cache) if (fl->sctx->smmu.cb && fl->cid != SDSP_DOMAIN_ID) buf->phys &= ~((uint64_t)fl->sctx->smmu.cb << 32); vmid = fl->apps->channel[fl->cid].vmid; if (vmid) { if ((vmid) && (me->in_hib == 0)) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(buf->phys, buf_page_size(buf->size), Loading Loading @@ -752,7 +754,7 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags) sess = fl->sctx; vmid = fl->apps->channel[fl->cid].vmid; if (vmid && map->phys) { if (vmid && map->phys && me->in_hib == 0) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(map->phys, buf_page_size(map->size), Loading Loading @@ -2243,7 +2245,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl, me->staticpd_flags = 0; if (mem && err) { if (mem->flags == ADSP_MMAP_REMOTE_HEAP_ADDR && me->channel[fl->cid].rhvm.vmid) && me->channel[fl->cid].rhvm.vmid && me->in_hib == 0) hyp_assign_phys(mem->phys, (uint64_t)mem->size, me->channel[fl->cid].rhvm.vmid, me->channel[fl->cid].rhvm.vmcount, Loading Loading @@ -2412,7 +2415,7 @@ static int fastrpc_munmap_on_dsp_rh(struct fastrpc_file *fl, uint64_t phys, err = scm_call2(SCM_SIP_FNID(SCM_SVC_PIL, TZ_PIL_CLEAR_PROTECT_MEM_SUBSYS_ID), &desc); } else if (flags == ADSP_MMAP_REMOTE_HEAP_ADDR) { if (me->channel[fl->cid].rhvm.vmid) { if ((me->channel[fl->cid].rhvm.vmid) && (me->in_hib == 0)) { VERIFY(err, !hyp_assign_phys(phys, (uint64_t)size, me->channel[fl->cid].rhvm.vmid, Loading Loading @@ -3254,6 +3257,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) me->channel[cid].prevssrcount = me->channel[cid].ssrcount; } me->in_hib = 0; mutex_unlock(&me->channel[cid].smd_mutex); bail: Loading Loading @@ -4147,6 +4151,7 @@ static int fastrpc_restore(struct device *dev) uint32_t val; pr_info("adsprpc: restore enter\n"); me->in_hib = 1; if (of_device_is_compatible(dev->of_node, "qcom,msm-adsprpc-mem-region")) { me->dev = dev; Loading Loading @@ -4244,6 +4249,7 @@ static int __init fastrpc_device_init(void) fastrpc_init(me); me->dev = NULL; me->legacy_remote_heap = 0; me->in_hib = 0; VERIFY(err, 0 == platform_driver_register(&fastrpc_driver)); if (err) goto register_bail; Loading Loading
drivers/char/adsprpc.c +10 −4 Original line number Diff line number Diff line Loading @@ -308,6 +308,7 @@ struct fastrpc_apps { spinlock_t ctxlock; struct smq_invoke_ctx *ctxtable[FASTRPC_CTX_MAX]; bool legacy_remote_heap; int in_hib; }; struct fastrpc_mmap { Loading Loading @@ -501,6 +502,7 @@ static void fastrpc_buf_free(struct fastrpc_buf *buf, int cache) { struct fastrpc_file *fl = buf == NULL ? NULL : buf->fl; int vmid; struct fastrpc_apps *me = &gfa; if (!fl) return; Loading @@ -524,7 +526,7 @@ static void fastrpc_buf_free(struct fastrpc_buf *buf, int cache) if (fl->sctx->smmu.cb && fl->cid != SDSP_DOMAIN_ID) buf->phys &= ~((uint64_t)fl->sctx->smmu.cb << 32); vmid = fl->apps->channel[fl->cid].vmid; if (vmid) { if ((vmid) && (me->in_hib == 0)) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(buf->phys, buf_page_size(buf->size), Loading Loading @@ -752,7 +754,7 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags) sess = fl->sctx; vmid = fl->apps->channel[fl->cid].vmid; if (vmid && map->phys) { if (vmid && map->phys && me->in_hib == 0) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(map->phys, buf_page_size(map->size), Loading Loading @@ -2243,7 +2245,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl, me->staticpd_flags = 0; if (mem && err) { if (mem->flags == ADSP_MMAP_REMOTE_HEAP_ADDR && me->channel[fl->cid].rhvm.vmid) && me->channel[fl->cid].rhvm.vmid && me->in_hib == 0) hyp_assign_phys(mem->phys, (uint64_t)mem->size, me->channel[fl->cid].rhvm.vmid, me->channel[fl->cid].rhvm.vmcount, Loading Loading @@ -2412,7 +2415,7 @@ static int fastrpc_munmap_on_dsp_rh(struct fastrpc_file *fl, uint64_t phys, err = scm_call2(SCM_SIP_FNID(SCM_SVC_PIL, TZ_PIL_CLEAR_PROTECT_MEM_SUBSYS_ID), &desc); } else if (flags == ADSP_MMAP_REMOTE_HEAP_ADDR) { if (me->channel[fl->cid].rhvm.vmid) { if ((me->channel[fl->cid].rhvm.vmid) && (me->in_hib == 0)) { VERIFY(err, !hyp_assign_phys(phys, (uint64_t)size, me->channel[fl->cid].rhvm.vmid, Loading Loading @@ -3254,6 +3257,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) me->channel[cid].prevssrcount = me->channel[cid].ssrcount; } me->in_hib = 0; mutex_unlock(&me->channel[cid].smd_mutex); bail: Loading Loading @@ -4147,6 +4151,7 @@ static int fastrpc_restore(struct device *dev) uint32_t val; pr_info("adsprpc: restore enter\n"); me->in_hib = 1; if (of_device_is_compatible(dev->of_node, "qcom,msm-adsprpc-mem-region")) { me->dev = dev; Loading Loading @@ -4244,6 +4249,7 @@ static int __init fastrpc_device_init(void) fastrpc_init(me); me->dev = NULL; me->legacy_remote_heap = 0; me->in_hib = 0; VERIFY(err, 0 == platform_driver_register(&fastrpc_driver)); if (err) goto register_bail; Loading