drivers/char: adsprpc: Remove Qcom's PM_QoS implementation

Qualcomm's QoS implementation wastes a significant power from
CPU cycles.
Scrap the QoS bits and save a bit power without hurting any
functionality.

Change-Id: I1de3563d9c99ba863f10a90a900d290bdd8e6b79
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Carlos Ayrton Lopez Arroyo <15030201@itcelaya.edu.mx>
This commit is contained in:
Panchajanya1999 2021-10-10 18:58:28 +05:30 committed by spakkkk
parent d89f76b07e
commit 67322ffa74

View File

@ -37,7 +37,6 @@
#include <soc/qcom/ramdump.h>
#include <linux/delay.h>
#include <linux/debugfs.h>
#include <linux/pm_qos.h>
#include <linux/stat.h>
#include <linux/cpumask.h>
@ -470,7 +469,6 @@ struct fastrpc_file {
struct hlist_head perf;
struct dentry *debugfs_file;
struct mutex perf_mutex;
struct pm_qos_request pm_qos_req;
int qos_request;
struct mutex map_mutex;
struct mutex internal_map_mutex;
@ -2851,50 +2849,6 @@ bail:
return err;
}
static int fastrpc_send_cpuinfo_to_dsp(struct fastrpc_file *fl)
{
int err = 0;
uint64_t cpuinfo = 0;
struct fastrpc_apps *me = &gfa;
struct fastrpc_ioctl_invoke_crc ioctl;
remote_arg_t ra[2];
int cid = -1;
if (!fl) {
err = -EBADF;
goto bail;
}
cid = fl->cid;
VERIFY(err, cid >= ADSP_DOMAIN_ID && cid < NUM_CHANNELS);
if (err) {
err = -ECHRNG;
pr_err("invalid channel 0x%zx set for session\n\n",
cid);
goto bail;
}
cpuinfo = me->channel[cid].cpuinfo_todsp;
/* return success if already updated to remote processor */
if (me->channel[cid].cpuinfo_status)
return 0;
ra[0].buf.pv = (void *)&cpuinfo;
ra[0].buf.len = sizeof(cpuinfo);
ioctl.inv.handle = FASTRPC_STATIC_HANDLE_DSP_UTILITIES;
ioctl.inv.sc = REMOTE_SCALARS_MAKE(1, 1, 0);
ioctl.inv.pra = ra;
ioctl.fds = NULL;
ioctl.attrs = NULL;
ioctl.crc = NULL;
fl->pd = 1;
err = fastrpc_internal_invoke(fl, FASTRPC_MODE_PARALLEL, 1, &ioctl);
if (!err)
me->channel[cid].cpuinfo_status = true;
bail:
return err;
}
static int fastrpc_get_info_from_dsp(struct fastrpc_file *fl,
uint32_t *dsp_attr_buf,
uint32_t dsp_attr_buf_len,
@ -3860,8 +3814,6 @@ static int fastrpc_device_release(struct inode *inode, struct file *file)
struct fastrpc_file *fl = (struct fastrpc_file *)file->private_data;
if (fl) {
if (fl->qos_request && pm_qos_request_active(&fl->pm_qos_req))
pm_qos_remove_request(&fl->pm_qos_req);
if (fl->debugfs_file != NULL)
debugfs_remove(fl->debugfs_file);
fastrpc_file_free(fl);
@ -4326,9 +4278,7 @@ static int fastrpc_internal_control(struct fastrpc_file *fl,
struct fastrpc_ioctl_control *cp)
{
int err = 0;
unsigned int latency;
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)
@ -4338,28 +4288,6 @@ static int fastrpc_internal_control(struct fastrpc_file *fl,
goto bail;
switch (cp->req) {
case FASTRPC_CONTROL_LATENCY:
latency = cp->lp.enable == FASTRPC_LATENCY_CTRL_ENB ?
fl->apps->latency : PM_QOS_DEFAULT_VALUE;
VERIFY(err, latency != 0);
if (err)
goto bail;
atomic_set(&fl->pm_qos_req.cpus_affine, 0);
for (i = 0; i < len; i++)
atomic_or(BIT(me->silvercores.coreno[i]),
&fl->pm_qos_req.cpus_affine);
fl->pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES;
if (!fl->qos_request) {
pm_qos_add_request(&fl->pm_qos_req,
PM_QOS_CPU_DMA_LATENCY, latency);
fl->qos_request = 1;
} else
pm_qos_update_request(&fl->pm_qos_req, latency);
/* Ensure CPU feature map updated to DSP for early WakeUp */
fastrpc_send_cpuinfo_to_dsp(fl);
break;
case FASTRPC_CONTROL_KALLOC:
cp->kalloc.kalloc_support = 1;
break;