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

Commit 486460fd authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: gsi: check channel state on timeout"

parents ec7ecc5e 93b3dc3d
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -2216,6 +2216,20 @@ int gsi_stop_channel(unsigned long chan_hdl)
	res = wait_for_completion_timeout(&ctx->compl,
			msecs_to_jiffies(GSI_STOP_CMD_TIMEOUT_MS));
	if (res == 0) {
		/*
		 * check channel state here in case the channel is stopped but
		 * the interrupt was not handled yet.
		 */
		val = gsi_readl(gsi_ctx->base +
			GSI_EE_n_GSI_CH_k_CNTXT_0_OFFS(chan_hdl,
			gsi_ctx->per.ee));
		ctx->state = (val &
			GSI_EE_n_GSI_CH_k_CNTXT_0_CHSTATE_BMSK) >>
			GSI_EE_n_GSI_CH_k_CNTXT_0_CHSTATE_SHFT;
		if (ctx->state == GSI_CHAN_STATE_STOPPED) {
			res = GSI_STATUS_SUCCESS;
			goto free_lock;
		}
		GSIDBG("chan_hdl=%lu timed out\n", chan_hdl);
		res = -GSI_STATUS_TIMED_OUT;
		goto free_lock;