msm: mdss: prevent deadlock during thread shutdown

The use of bl_lock is to protect backlight related resources, however by
holding it during display thread shutdown it may lead to deadlock if the
same is being acquired inside display thread. Reduce the scope of the
lock to just the backlight resources to prevent deadlock.

Change-Id: I6e4b9a970c4a5a050caab1b3714e90eda107edee
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
This commit is contained in:
Adrian Salido-Moreno 2014-11-24 21:21:50 -08:00 committed by David Keitel
parent ffaf975ec3
commit ad245195a0

View file

@ -1236,16 +1236,16 @@ static int mdss_fb_blank_blank(struct msm_fb_data_type *mfd,
complete(&mfd->no_update.comp);
mfd->op_enable = false;
mutex_lock(&mfd->bl_lock);
if (mdss_panel_is_power_off(req_power_state)) {
/* Stop Display thread */
if (mfd->disp_thread)
mdss_fb_stop_disp_thread(mfd);
mutex_lock(&mfd->bl_lock);
mdss_fb_set_backlight(mfd, 0);
mfd->bl_updated = 0;
mutex_unlock(&mfd->bl_lock);
}
mfd->panel_power_state = req_power_state;
mutex_unlock(&mfd->bl_lock);
ret = mfd->mdp.off_fnc(mfd);
if (ret)