Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb5017ba authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: ADSPRPC: Log release error only when init is successful



Log fastrpc device release error only when fastrpc init process
is completely successful to avoid excessive logging in case of
DSP is up or init process is continuosly failing.Also invoke
kill dsp process, only when subsystem is up

Change-Id: I5d7c85cb96baf6508622512d0a0ace0c5de54e21
Acked-by: default avatarHimateja Reddy <hmreddy@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent c3715e11
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -374,6 +374,7 @@ struct fastrpc_file {
	int pd;
	char *spdname;
	int file_close;
	int dsp_process_init;
	struct fastrpc_apps *apps;
	struct hlist_head perf;
	struct dentry *debugfs_file;
@@ -2183,7 +2184,9 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
			goto bail;
	} else {
		err = -ENOTTY;
		goto bail;
	}
	fl->dsp_process_init = 1;
bail:
	kfree(proc_name);
	if (err && (init->flags == FASTRPC_INIT_CREATE_STATIC))
@@ -2221,6 +2224,9 @@ static int fastrpc_release_current_dsp_process(struct fastrpc_file *fl)
	if (err)
		goto bail;
	VERIFY(err, fl->apps->channel[fl->cid].rpdev != NULL);
	if (err)
		goto bail;
	VERIFY(err, fl->apps->channel[fl->cid].issubsystemup == 1);
	if (err)
		goto bail;
	tgid = fl->tgid;
@@ -2234,7 +2240,7 @@ static int fastrpc_release_current_dsp_process(struct fastrpc_file *fl)
	ioctl.crc = NULL;
	VERIFY(err, 0 == (err = fastrpc_internal_invoke(fl,
		FASTRPC_MODE_PARALLEL, 1, &ioctl)));
	if (err)
	if (err && fl->dsp_process_init)
		pr_err("adsprpc: %s: releasing DSP process failed for %s, returned 0x%x",
					__func__, current->comm, err);
bail:
@@ -3239,6 +3245,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
		fl->debugfs_file = debugfs_file;
	memset(&fl->perf, 0, sizeof(fl->perf));
	fl->qos_request = 0;
	fl->dsp_process_init = 0;
	filp->private_data = fl;
	mutex_init(&fl->internal_map_mutex);
	mutex_init(&fl->map_mutex);