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

Commit d3ad2d97 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
Browse files

msm: mdss: protect clk enable member with mdp lock



During irq_disable, mdp_lock is held and intr status is checked and
cleared if any. If a new irq is triggered from another CPU at the
same point, it would ideally be waiting on mdp_lock held by the other
CPU. And when the mdp_lock is released after clearing the irq, mdp_isr
is executed and at this point, clks might have been disabled. To avoid
it, protect the clk_ena variable with mdp_lock and also check for the
clk_ena status and skip irq handling when it is disabled.

Change-Id: Ic71d2b6f877ca3510a0d0fa593a8a0c17e93d8f3
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent e5cb9812
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -941,6 +941,7 @@ void mdss_mdp_clk_ctrl(int enable)
{
	struct mdss_data_type *mdata = mdss_mdp_get_mdata();
	static int mdp_clk_cnt;
	unsigned long flags;
	int changed = 0;
	int rc = 0;

@@ -982,7 +983,10 @@ void mdss_mdp_clk_ctrl(int enable)
				false, mdata->curr_bw_uc_idx);
		}

		spin_lock_irqsave(&mdp_lock, flags);
		mdata->clk_ena = enable;
		spin_unlock_irqrestore(&mdp_lock, flags);

		mdss_mdp_clk_update(MDSS_CLK_AHB, enable);
		mdss_mdp_clk_update(MDSS_CLK_AXI, enable);
		mdss_mdp_clk_update(MDSS_CLK_MDP_CORE, enable);
+2 −0
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@ irqreturn_t mdss_mdp_isr(int irq, void *ptr)
	struct mdss_data_type *mdata = ptr;
	u32 isr, mask, hist_isr, hist_mask;

	if (!mdata->clk_ena)
		return IRQ_HANDLED;

	isr = readl_relaxed(mdata->mdp_base + MDSS_MDP_REG_INTR_STATUS);