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

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

msm: ADSPRPC: Do not connect to DSP if fastRPC probe fails



If fastRPC probe fails adsprpc-mem device would be uninitialized.
Do not offload to DSP in such cases and return ECONNREFUSED error
code to userspace.

Change-Id: I0a1f1bda88960937ff7f0f9a27def77def184d39
Acked-by: default avatarVishnu Karthik D <vikarthi@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 662833d0
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2805,8 +2805,10 @@ static int fastrpc_session_alloc_locked(struct fastrpc_channel_ctx *chan,
		chan->session[idx].smmu.faults = 0;
	} else {
		VERIFY(err, me->dev != NULL);
		if (err)
		if (err) {
			err = -ECONNREFUSED;
			goto bail;
		}
		chan->session[0].dev = me->dev;
		chan->session[0].smmu.dev = me->dev;
	}
@@ -3395,8 +3397,8 @@ static int fastrpc_get_info(struct fastrpc_file *fl, uint32_t *info)
		fl->cid = cid;
		fl->ssrcount = fl->apps->channel[cid].ssrcount;
		mutex_lock(&fl->apps->channel[cid].smd_mutex);
		VERIFY(err, !fastrpc_session_alloc_locked(
				&fl->apps->channel[cid], 0, &fl->sctx));
		VERIFY(err, 0 == (err = fastrpc_session_alloc_locked(
				&fl->apps->channel[cid], 0, &fl->sctx)));
		mutex_unlock(&fl->apps->channel[cid].smd_mutex);
		if (err)
			goto bail;