From 4a73f2adf8c7dfeac144bd3dbc81be7bed903ae3 Mon Sep 17 00:00:00 2001 From: Aravind Venkateswaran Date: Wed, 14 Jan 2015 23:19:03 -0800 Subject: [PATCH] msm: mdss: fix potential crash when sending backlight DCS commands If MDSS idle power collapse feature is enabled, MDSS GDSC can get toggled when exiting idle power collapse. This may require an explicit call to TZ to restore MDSS security configs prior to accessing any MDSS registers, which is typically done whenever IOMMU is attached. For panels where backlight is controlled using DCS commands, it is possible that a backlight update could be triggered when MDSS is power collapsed. This would result in enabling MDSS GDSC and restoring DSI registers prior to sending the DCS commands. For such use cases, ensure that IOMMU is attached prior to any register programming to avoid any crashes. Change-Id: I245d1180cfeedeb938e70b792fd6d627e86c5d14 Signed-off-by: Aravind Venkateswaran --- drivers/video/fbdev/msm/mdss_dsi_host.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index a70375559fef..1c7d55cecd30 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -2023,7 +2023,6 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) ctrl->mdss_util->bus_scale_set_quota(MDSS_DSI_RT, SZ_1M, SZ_1M); pr_debug("%s: from_mdp=%d pid=%d\n", __func__, from_mdp, current->pid); - mdss_dsi_clk_ctrl(ctrl, DSI_ALL_CLKS, 1); if (ctrl->mdss_util->iommu_ctrl) { rc = ctrl->mdss_util->iommu_ctrl(1); @@ -2034,6 +2033,8 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) } } + mdss_dsi_clk_ctrl(ctrl, DSI_ALL_CLKS, 1); + if (req->flags & CMD_REQ_HS_MODE) mdss_dsi_set_tx_power_mode(0, &ctrl->panel_data);