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

Commit 37a26a8a authored by Kuogee Hsieh's avatar Kuogee Hsieh
Browse files

msm: mdss: spin lock is necessary when reset rdptr_enabled



At cmd_stop, spin lock protection is necessary when reset rdptr_enabled
to 1. Otherwise race condition may happen and cause timeout.

CRs-Fixed: 766216
Change-Id: I128f73a069d3068c852f4b25c6515ec834e82162
Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
parent e22a9bf6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -859,6 +859,7 @@ int mdss_mdp_cmd_intfs_stop(struct mdss_mdp_ctl *ctl, int session,
	struct mdss_mdp_cmd_ctx *sctx = NULL;
	struct mdss_mdp_cmd_ctx *ctx;
	unsigned long flags;
	unsigned long sflags;
	int need_wait = 0;
	int ret = 0;
	int hz;
@@ -894,8 +895,12 @@ int mdss_mdp_cmd_intfs_stop(struct mdss_mdp_ctl *ctl, int session,
		 * next vsync if there has no kickoff pending
		 */
		ctx->rdptr_enabled = 1;
		if (sctx && sctx->rdptr_enabled)
		if (sctx) {
			spin_lock_irqsave(&sctx->clk_lock, sflags);
			if (sctx->rdptr_enabled)
				sctx->rdptr_enabled = 1;
			spin_unlock_irqrestore(&sctx->clk_lock, sflags);
		}
	}
	spin_unlock_irqrestore(&ctx->clk_lock, flags);