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

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

msm: ADSPRPC: handle static PDR during daemon start and kill



Set the signal only if the msg.pid variable is not NULL.

Change-Id: Iac70d2db43782985282d7fe00efb607fc7cd81b9
Acked-by: default avatarKrishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: default avatarTharun Kumar Merugu <mtharu@codeaurora.org>
parent 23cc55e8
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -1256,6 +1256,25 @@ static void fastrpc_notify_users(struct fastrpc_file *me)

}


static void fastrpc_notify_users_staticpd_pdr(struct fastrpc_file *me)
{
	struct smq_invoke_ctx *ictx;
	struct hlist_node *n;

	spin_lock(&me->hlock);
	hlist_for_each_entry_safe(ictx, n, &me->clst.pending, hn) {
		if (ictx->msg.pid)
			complete(&ictx->work);
	}
	hlist_for_each_entry_safe(ictx, n, &me->clst.interrupted, hn) {
		if (ictx->msg.pid)
			complete(&ictx->work);
	}
	spin_unlock(&me->hlock);
}


static void fastrpc_notify_drivers(struct fastrpc_apps *me, int cid)
{
	struct fastrpc_file *fl;
@@ -1278,7 +1297,7 @@ static void fastrpc_notify_pdr_drivers(struct fastrpc_apps *me, char *spdname)
	spin_lock(&me->hlock);
	hlist_for_each_entry_safe(fl, n, &me->drivers, hn) {
		if (fl->spdname && !strcmp(spdname, fl->spdname))
			fastrpc_notify_users(fl);
			fastrpc_notify_users_staticpd_pdr(fl);
	}
	spin_unlock(&me->hlock);