Loading drivers/char/adsprpc.c +12 −8 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ struct fastrpc_channel_ctx { struct mutex rpmsg_mutex; uint64_t sesscount; uint64_t ssrcount; int in_hib; void *handle; uint64_t prevssrcount; int issubsystemup; Loading Loading @@ -309,7 +310,6 @@ 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 @@ -527,7 +527,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) && (me->in_hib == 0)) { if ((vmid) && (me->channel[fl->cid].in_hib == 0)) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(buf->phys, buf_page_size(buf->size), Loading Loading @@ -755,7 +755,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 && me->in_hib == 0) { if (vmid && map->phys && (me->channel[fl->cid].in_hib == 0)) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(map->phys, buf_page_size(map->size), Loading Loading @@ -2261,7 +2261,7 @@ static int fastrpc_init_process(struct fastrpc_file *fl, if (mem && err) { if (mem->flags == ADSP_MMAP_REMOTE_HEAP_ADDR && me->channel[fl->cid].rhvm.vmid && me->in_hib == 0) && me->channel[fl->cid].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 @@ -2430,7 +2430,8 @@ 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) && (me->in_hib == 0)) { if ((me->channel[fl->cid].rhvm.vmid) && (me->channel[fl->cid].in_hib == 0)) { VERIFY(err, !hyp_assign_phys(phys, (uint64_t)size, me->channel[fl->cid].rhvm.vmid, Loading Loading @@ -3282,7 +3283,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) me->channel[cid].prevssrcount = me->channel[cid].ssrcount; } me->in_hib = 0; me->channel[cid].in_hib = 0; mutex_unlock(&me->channel[cid].smd_mutex); bail: Loading Loading @@ -4198,9 +4199,12 @@ static int fastrpc_restore(struct device *dev) struct platform_device *ion_pdev; struct cma *cma; uint32_t val; int cid; pr_info("adsprpc: restore enter\n"); me->in_hib = 1; for (cid = 0; cid < NUM_CHANNELS; cid++) me->channel[cid].in_hib = 1; if (of_device_is_compatible(dev->of_node, "qcom,msm-adsprpc-mem-region")) { me->dev = dev; Loading Loading @@ -4304,7 +4308,6 @@ 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 @@ -4348,6 +4351,7 @@ static int __init fastrpc_device_init(void) if (i == CDSP_DOMAIN_ID) me->channel[i].dev = dev; me->channel[i].ssrcount = 0; me->channel[i].in_hib = 0; me->channel[i].prevssrcount = 0; me->channel[i].issubsystemup = 1; me->channel[i].ramdumpenabled = 0; Loading Loading
drivers/char/adsprpc.c +12 −8 Original line number Diff line number Diff line Loading @@ -281,6 +281,7 @@ struct fastrpc_channel_ctx { struct mutex rpmsg_mutex; uint64_t sesscount; uint64_t ssrcount; int in_hib; void *handle; uint64_t prevssrcount; int issubsystemup; Loading Loading @@ -309,7 +310,6 @@ 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 @@ -527,7 +527,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) && (me->in_hib == 0)) { if ((vmid) && (me->channel[fl->cid].in_hib == 0)) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(buf->phys, buf_page_size(buf->size), Loading Loading @@ -755,7 +755,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 && me->in_hib == 0) { if (vmid && map->phys && (me->channel[fl->cid].in_hib == 0)) { int srcVM[2] = {VMID_HLOS, vmid}; hyp_assign_phys(map->phys, buf_page_size(map->size), Loading Loading @@ -2261,7 +2261,7 @@ static int fastrpc_init_process(struct fastrpc_file *fl, if (mem && err) { if (mem->flags == ADSP_MMAP_REMOTE_HEAP_ADDR && me->channel[fl->cid].rhvm.vmid && me->in_hib == 0) && me->channel[fl->cid].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 @@ -2430,7 +2430,8 @@ 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) && (me->in_hib == 0)) { if ((me->channel[fl->cid].rhvm.vmid) && (me->channel[fl->cid].in_hib == 0)) { VERIFY(err, !hyp_assign_phys(phys, (uint64_t)size, me->channel[fl->cid].rhvm.vmid, Loading Loading @@ -3282,7 +3283,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl) me->channel[cid].prevssrcount = me->channel[cid].ssrcount; } me->in_hib = 0; me->channel[cid].in_hib = 0; mutex_unlock(&me->channel[cid].smd_mutex); bail: Loading Loading @@ -4198,9 +4199,12 @@ static int fastrpc_restore(struct device *dev) struct platform_device *ion_pdev; struct cma *cma; uint32_t val; int cid; pr_info("adsprpc: restore enter\n"); me->in_hib = 1; for (cid = 0; cid < NUM_CHANNELS; cid++) me->channel[cid].in_hib = 1; if (of_device_is_compatible(dev->of_node, "qcom,msm-adsprpc-mem-region")) { me->dev = dev; Loading Loading @@ -4304,7 +4308,6 @@ 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 @@ -4348,6 +4351,7 @@ static int __init fastrpc_device_init(void) if (i == CDSP_DOMAIN_ID) me->channel[i].dev = dev; me->channel[i].ssrcount = 0; me->channel[i].in_hib = 0; me->channel[i].prevssrcount = 0; me->channel[i].issubsystemup = 1; me->channel[i].ramdumpenabled = 0; Loading