summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2016-01-28 18:09:14 -0500
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:17:47 -0700
commit6b236392b5b94390c4e11ef8f59a4c03be5bf586 (patch)
tree5e0aa6710cc75103e9f5833461d15c5e5dced8ef /drivers/video/fbdev
parent40ac095b5b0d580375732e5a33fb8e1a2b8025dc (diff)
msm: mdss: false ESD detections due to race condition
There is a race condition between ESD thread and commit thread which causes false ESD detections. This change prevents the condition. Change-Id: I67a480f7251348fc86be01fe8d5414857f53bc75 Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/dsi_host_v2.c4
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_cmd.c11
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_cmd.h5
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi_host.c2
4 files changed, 15 insertions, 7 deletions
diff --git a/drivers/video/fbdev/msm/dsi_host_v2.c b/drivers/video/fbdev/msm/dsi_host_v2.c
index 9b4afb265b00..a8a6c2b7afac 100644
--- a/drivers/video/fbdev/msm/dsi_host_v2.c
+++ b/drivers/video/fbdev/msm/dsi_host_v2.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -1000,7 +1000,7 @@ int msm_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
if (from_mdp) /* from mdp kickoff */
mutex_lock(&ctrl->cmd_mutex);
- req = mdss_dsi_cmdlist_get(ctrl);
+ req = mdss_dsi_cmdlist_get(ctrl, from_mdp);
if (!req) {
mutex_unlock(&ctrl->cmd_mutex);
diff --git a/drivers/video/fbdev/msm/mdss_dsi_cmd.c b/drivers/video/fbdev/msm/mdss_dsi_cmd.c
index 0e7de6654e25..d07b504ff302 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_cmd.c
+++ b/drivers/video/fbdev/msm/mdss_dsi_cmd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -724,7 +724,8 @@ void mdss_dsi_set_tear_off(struct mdss_dsi_ctrl_pdata *ctrl)
/*
* mdss_dsi_cmd_get: ctrl->cmd_mutex acquired by caller
*/
-struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl)
+struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl,
+ int from_mdp)
{
struct dcs_cmd_list *clist;
struct dcs_cmd_req *req = NULL;
@@ -733,6 +734,12 @@ struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl)
clist = &ctrl->cmdlist;
if (clist->get != clist->put) {
req = &clist->list[clist->get];
+ /*dont let commit thread steal ESD thread's
+ command*/
+ if (from_mdp && (req->flags & CMD_REQ_COMMIT)) {
+ mutex_unlock(&ctrl->cmdlist_mutex);
+ return NULL;
+ }
clist->get++;
clist->get %= CMD_REQ_MAX;
clist->tot--;
diff --git a/drivers/video/fbdev/msm/mdss_dsi_cmd.h b/drivers/video/fbdev/msm/mdss_dsi_cmd.h
index d62711558cd8..0ca968a00460 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_cmd.h
+++ b/drivers/video/fbdev/msm/mdss_dsi_cmd.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -133,7 +133,8 @@ int mdss_dsi_short_read2_resp(struct dsi_buf *rp);
int mdss_dsi_long_read_resp(struct dsi_buf *rp);
void mdss_dsi_set_tear_on(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_set_tear_off(struct mdss_dsi_ctrl_pdata *ctrl);
-struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl);
+struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl,
+ int from_mdp);
int mdss_dsi_cmdlist_put(struct mdss_dsi_ctrl_pdata *ctrl,
struct dcs_cmd_req *cmdreq);
#endif
diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c
index cc0cbea6fced..5f9c936b54ba 100644
--- a/drivers/video/fbdev/msm/mdss_dsi_host.c
+++ b/drivers/video/fbdev/msm/mdss_dsi_host.c
@@ -2403,7 +2403,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
roi = &pinfo->roi;
}
- req = mdss_dsi_cmdlist_get(ctrl);
+ req = mdss_dsi_cmdlist_get(ctrl, from_mdp);
if (req && from_mdp && ctrl->burst_mode_enabled) {
mutex_lock(&ctrl->cmd_mutex);
cmd_mutex_acquired = true;