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

Commit d52887dd authored by Dhoat Harpal's avatar Dhoat Harpal Committed by Chris Lew
Browse files

soc: qcom: glink: Change cleanup sequence in remote close



In function glink_core_remote_close_common, notify_state callback
is called before clearing wait queue. This leads to deadlock if client
want to synchronize tx and state notify function.

Complete_all is called before notify client about state change,
so that all pending requests from client will be cleared.

CRs-Fixed: 1107652
Change-Id: Ia6c4a305eb42c014a928bad36491e6e5f6eac9d5
Signed-off-by: default avatarDhoat Harpal <hdhoat@codeaurora.org>
parent ecf7b273
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -583,6 +583,9 @@ static bool glink_core_remote_close_common(struct channel_ctx *ctx, bool safe)
	}
	ctx->rcid = 0;

	ctx->int_req_ack = false;
	complete_all(&ctx->int_req_ack_complete);
	complete_all(&ctx->int_req_complete);
	if (ctx->local_open_state != GLINK_CHANNEL_CLOSED &&
		ctx->local_open_state != GLINK_CHANNEL_CLOSING) {
		if (ctx->notify_state)
@@ -599,9 +602,6 @@ static bool glink_core_remote_close_common(struct channel_ctx *ctx, bool safe)
			"Did not send GLINK_REMOTE_DISCONNECTED",
			"local state is already CLOSED");

	ctx->int_req_ack = false;
	complete_all(&ctx->int_req_ack_complete);
	complete_all(&ctx->int_req_complete);
	ch_purge_intent_lists(ctx);

	return is_fully_closed;