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

Commit 898efa1f authored by Dhoat Harpal's avatar Dhoat Harpal Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: glink_smd_xprt: Fix ssr sync during intent request



Synchronization is absent between SSR and intent request, which
result in dead lock scenerio.

ssr_sync rcu lock is used to synchronize intent request and SSR.

CRs-Fixed: 1025593
Change-Id: I1ac06aace8d79ad92d2b48cfb51e1394ef68906c
Signed-off-by: default avatarDhoat Harpal <hdhoat@codeaurora.org>
parent 400520a6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1854,8 +1854,14 @@ static int tx_cmd_rx_intent_req(struct glink_transport_if *if_ptr,
	struct edge_info *einfo;
	struct channel *ch;
	unsigned long flags;
	int rcu_id;

	einfo = container_of(if_ptr, struct edge_info, xprt_if);
	rcu_id = srcu_read_lock(&einfo->ssr_sync);
	if (einfo->in_ssr) {
		srcu_read_unlock(&einfo->ssr_sync, rcu_id);
		return -EFAULT;
	}
	spin_lock_irqsave(&einfo->channels_lock, flags);
	list_for_each_entry(ch, &einfo->channels, node) {
		if (lcid == ch->lcid)
@@ -1871,6 +1877,7 @@ static int tx_cmd_rx_intent_req(struct glink_transport_if *if_ptr,
							ch->rcid,
							ch->next_intent_id++,
							size);
	srcu_read_unlock(&einfo->ssr_sync, rcu_id);
	return 0;
}