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

Commit 53a8ec9f authored by Tharun Kumar Merugu's avatar Tharun Kumar Merugu
Browse files

msm: ADSPRPC: define separate signals for port and link states



Handle Glink register bail path in case of SSR.

Change-Id: I782788fe4c45dfbe4c1608f80465e99f3b8284ce
Acked-by: default avatarKrishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent c5265904
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ struct fastrpc_channel_ctx {
	struct device *dev;
	struct fastrpc_session_ctx session[NUM_SESSIONS];
	struct completion work;
	struct completion workport;
	struct notifier_block nb;
	struct kref kref;
	int sesscount;
@@ -1268,6 +1269,7 @@ static void fastrpc_init(struct fastrpc_apps *me)
	me->channel = &gcinfo[0];
	for (i = 0; i < NUM_CHANNELS; i++) {
		init_completion(&me->channel[i].work);
		init_completion(&me->channel[i].workport);
		me->channel[i].sesscount = 0;
	}
}
@@ -1669,7 +1671,7 @@ void fastrpc_glink_notify_state(void *handle, const void *priv,
	switch (event) {
	case GLINK_CONNECTED:
		link->port_state = FASTRPC_LINK_CONNECTED;
		complete(&me->channel[cid].work);
		complete(&me->channel[cid].workport);
		break;
	case GLINK_LOCAL_DISCONNECTED:
		link->port_state = FASTRPC_LINK_DISCONNECTED;
@@ -1815,8 +1817,7 @@ static void fastrpc_glink_close(void *chan, int cid)
		return;
	link = &gfa.channel[cid].link;

	if (link->port_state == FASTRPC_LINK_CONNECTED ||
		link->port_state == FASTRPC_LINK_CONNECTING) {
	if (link->port_state == FASTRPC_LINK_CONNECTED) {
		link->port_state = FASTRPC_LINK_DISCONNECTING;
		glink_close(chan);
	}
@@ -1898,7 +1899,8 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
		if (err)
			goto bail;

		VERIFY(err, wait_for_completion_timeout(&me->channel[cid].work,
		VERIFY(err,
			 wait_for_completion_timeout(&me->channel[cid].workport,
						RPC_TIMEOUT));
		if (err) {
			me->channel[cid].chan = 0;