Loading drivers/char/adsprpc.c +51 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ #include <linux/debugfs.h> #include <linux/pm_qos.h> #include <linux/stat.h> #include <linux/cpumask.h> #define CREATE_TRACE_POINTS #include <trace/events/fastrpc.h> Loading Loading @@ -224,6 +225,11 @@ struct secure_vm { int vmcount; }; struct qos_cores { int *coreno; int corecount; }; struct fastrpc_file; struct fastrpc_buf { Loading Loading @@ -370,6 +376,7 @@ struct fastrpc_apps { /* Unique job id for each message */ uint64_t jobid[NUM_CHANNELS]; struct wakeup_source *wake_source; struct qos_cores silvercores; }; struct fastrpc_mmap { Loading Loading @@ -3954,6 +3961,9 @@ static int fastrpc_internal_control(struct fastrpc_file *fl, { int err = 0; unsigned int latency; cpumask_t mask; struct fastrpc_apps *me = &gfa; u32 len = me->silvercores.corecount, i = 0; VERIFY(err, !IS_ERR_OR_NULL(fl) && !IS_ERR_OR_NULL(fl->apps)); if (err) Loading @@ -3969,6 +3979,12 @@ static int fastrpc_internal_control(struct fastrpc_file *fl, VERIFY(err, latency != 0); if (err) goto bail; cpumask_clear(&mask); for (i = 0; i < len; i++) cpumask_set_cpu(me->silvercores.coreno[i], &mask); fl->pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES; cpumask_copy(&fl->pm_qos_req.cpus_affine, &mask); if (!fl->qos_request) { pm_qos_add_request(&fl->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, latency); Loading Loading @@ -4580,6 +4596,39 @@ static void init_secure_vmid_list(struct device *dev, char *prop_name, } } static void init_qos_cores_list(struct device *dev, char *prop_name, struct qos_cores *silvercores) { int err = 0; u32 len = 0, i = 0; u32 *coreslist = NULL; if (!of_find_property(dev->of_node, prop_name, &len)) goto bail; if (len == 0) goto bail; len /= sizeof(u32); VERIFY(err, NULL != (coreslist = kcalloc(len, sizeof(u32), GFP_KERNEL))); if (err) goto bail; for (i = 0; i < len; i++) { err = of_property_read_u32_index(dev->of_node, prop_name, i, &coreslist[i]); if (err) { pr_err("adsprpc: %s: failed to read QOS cores list\n", __func__); goto bail; } } silvercores->coreno = coreslist; silvercores->corecount = len; bail: if (err) { kfree(coreslist); } } static void configure_secure_channels(uint32_t secure_domains) { struct fastrpc_apps *me = &gfa; Loading Loading @@ -4617,6 +4666,8 @@ static int fastrpc_probe(struct platform_device *pdev) "qcom,msm-fastrpc-compute")) { init_secure_vmid_list(dev, "qcom,adsp-remoteheap-vmid", &gcinfo[0].rhvm); init_qos_cores_list(dev, "qcom,qos-cores", &me->silvercores); of_property_read_u32(dev->of_node, "qcom,rpc-latency-us", Loading Loading
drivers/char/adsprpc.c +51 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ #include <linux/debugfs.h> #include <linux/pm_qos.h> #include <linux/stat.h> #include <linux/cpumask.h> #define CREATE_TRACE_POINTS #include <trace/events/fastrpc.h> Loading Loading @@ -224,6 +225,11 @@ struct secure_vm { int vmcount; }; struct qos_cores { int *coreno; int corecount; }; struct fastrpc_file; struct fastrpc_buf { Loading Loading @@ -370,6 +376,7 @@ struct fastrpc_apps { /* Unique job id for each message */ uint64_t jobid[NUM_CHANNELS]; struct wakeup_source *wake_source; struct qos_cores silvercores; }; struct fastrpc_mmap { Loading Loading @@ -3954,6 +3961,9 @@ static int fastrpc_internal_control(struct fastrpc_file *fl, { int err = 0; unsigned int latency; cpumask_t mask; struct fastrpc_apps *me = &gfa; u32 len = me->silvercores.corecount, i = 0; VERIFY(err, !IS_ERR_OR_NULL(fl) && !IS_ERR_OR_NULL(fl->apps)); if (err) Loading @@ -3969,6 +3979,12 @@ static int fastrpc_internal_control(struct fastrpc_file *fl, VERIFY(err, latency != 0); if (err) goto bail; cpumask_clear(&mask); for (i = 0; i < len; i++) cpumask_set_cpu(me->silvercores.coreno[i], &mask); fl->pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES; cpumask_copy(&fl->pm_qos_req.cpus_affine, &mask); if (!fl->qos_request) { pm_qos_add_request(&fl->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, latency); Loading Loading @@ -4580,6 +4596,39 @@ static void init_secure_vmid_list(struct device *dev, char *prop_name, } } static void init_qos_cores_list(struct device *dev, char *prop_name, struct qos_cores *silvercores) { int err = 0; u32 len = 0, i = 0; u32 *coreslist = NULL; if (!of_find_property(dev->of_node, prop_name, &len)) goto bail; if (len == 0) goto bail; len /= sizeof(u32); VERIFY(err, NULL != (coreslist = kcalloc(len, sizeof(u32), GFP_KERNEL))); if (err) goto bail; for (i = 0; i < len; i++) { err = of_property_read_u32_index(dev->of_node, prop_name, i, &coreslist[i]); if (err) { pr_err("adsprpc: %s: failed to read QOS cores list\n", __func__); goto bail; } } silvercores->coreno = coreslist; silvercores->corecount = len; bail: if (err) { kfree(coreslist); } } static void configure_secure_channels(uint32_t secure_domains) { struct fastrpc_apps *me = &gfa; Loading Loading @@ -4617,6 +4666,8 @@ static int fastrpc_probe(struct platform_device *pdev) "qcom,msm-fastrpc-compute")) { init_secure_vmid_list(dev, "qcom,adsp-remoteheap-vmid", &gcinfo[0].rhvm); init_qos_cores_list(dev, "qcom,qos-cores", &me->silvercores); of_property_read_u32(dev->of_node, "qcom,rpc-latency-us", Loading