summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAravind Venkateswaran <aravindh@codeaurora.org>2013-12-04 17:09:53 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:24:09 -0700
commitef0ed7a8dae34fa9f6baaaeadd4e18cffeea5bf6 (patch)
tree3533363126f36194849dbd73ee4f1eb17b3b6e99 /drivers
parentae8ccdf2f36f4e3edf297a48e5affeb4adad4ce8 (diff)
msm: mdss: stop display commit thread only if it is running
When the framebuffer device is shutdown, it is possible that the display commit thread has already been stopped. In such scenarios, ensure that we not attempt to stop the thread again to avoid any potential crashes. CRs-Fixed: 584499 Change-Id: If0026cdcc4367c149815933ffe4ed08056d54770 Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/fbdev/msm/mdss_fb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c
index da8ee4a4bcf3..ad72d160e221 100644
--- a/drivers/video/fbdev/msm/mdss_fb.c
+++ b/drivers/video/fbdev/msm/mdss_fb.c
@@ -1197,6 +1197,7 @@ static int mdss_fb_open(struct fb_info *info, int user)
pr_err("unable to start display thread %d\n",
mfd->index);
result = PTR_ERR(mfd->disp_thread);
+ mfd->disp_thread = NULL;
goto thread_error;
}
@@ -1216,6 +1217,7 @@ static int mdss_fb_open(struct fb_info *info, int user)
blank_error:
kthread_stop(mfd->disp_thread);
+ mfd->disp_thread = NULL;
thread_error:
if (pinfo && !pinfo->ref_cnt) {
@@ -1267,8 +1269,10 @@ static int mdss_fb_release_all(struct fb_info *info, bool release_all)
pm_runtime_put(info->dev);
} while (release_all && pinfo->ref_cnt);
- if (release_all)
+ if (release_all && mfd->disp_thread) {
kthread_stop(mfd->disp_thread);
+ mfd->disp_thread = NULL;
+ }
if (pinfo->ref_cnt == 0) {
list_del(&pinfo->list);
@@ -1306,7 +1310,10 @@ static int mdss_fb_release_all(struct fb_info *info, bool release_all)
}
if (!mfd->ref_cnt) {
- kthread_stop(mfd->disp_thread);
+ if (mfd->disp_thread) {
+ kthread_stop(mfd->disp_thread);
+ mfd->disp_thread = NULL;
+ }
ret = mdss_fb_blank_sub(FB_BLANK_POWERDOWN, info,
mfd->op_enable);