summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraghavendra ambadas <rambad@codeaurora.org>2020-04-02 12:29:12 +0530
committerraghavendra ambadas <rambad@codeaurora.org>2020-04-02 12:36:34 +0530
commitf25360d98491203b1691e63b89c251a0c2f57a8a (patch)
tree674d913741f346f5b9b66498acfc0ca2072163a4
parenta0f7b85fea0f15b41b99cd9e4ee5504b97d814a1 (diff)
fbdev: msm: Fix race condition during te_irq calls
Add lock to synchronize te_irq calls from both the dsi blank/unblank and wait4pingpong function calls. Change-Id: If59e7efe55ff8f7f9eb61d6297aefedb857e7abf Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.c1
-rw-r--r--drivers/video/fbdev/msm/mdss_panel.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index cc5f21131809..bffbb731dd4a 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.c
+++ b/drivers/video/fbdev/msm/mdss_dsi.c
@@ -3685,6 +3685,7 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
pdata = &ctrl_pdata->panel_data;
init_completion(&pdata->te_done);
+ mutex_init(&pdata->te_mutex);
if (pdata->panel_info.type == MIPI_CMD_PANEL) {
if (!te_irq_registered) {
rc = devm_request_irq(&pdev->dev,
diff --git a/drivers/video/fbdev/msm/mdss_panel.h b/drivers/video/fbdev/msm/mdss_panel.h
index 200acc5e61aa..bc2513296fd8 100644
--- a/drivers/video/fbdev/msm/mdss_panel.h
+++ b/drivers/video/fbdev/msm/mdss_panel.h
@@ -1014,6 +1014,7 @@ struct mdss_panel_data {
int panel_te_gpio;
bool is_te_irq_enabled;
+ struct mutex te_mutex;
struct completion te_done;
};
@@ -1033,6 +1034,7 @@ static inline void panel_update_te_irq(struct mdss_panel_data *pdata,
return;
}
+ mutex_lock(&pdata->te_mutex);
if (enable && !pdata->is_te_irq_enabled) {
enable_irq(gpio_to_irq(pdata->panel_te_gpio));
pdata->is_te_irq_enabled = true;
@@ -1040,6 +1042,8 @@ static inline void panel_update_te_irq(struct mdss_panel_data *pdata,
disable_irq(gpio_to_irq(pdata->panel_te_gpio));
pdata->is_te_irq_enabled = false;
}
+ mutex_unlock(&pdata->te_mutex);
+
}
/**