diff options
| author | Dhaval Patel <pdhaval@codeaurora.org> | 2015-11-16 15:20:05 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:11:45 -0700 |
| commit | e63ebb69114525d932845e6ce34c356c7e60bc87 (patch) | |
| tree | 459188c988724bd85d4e015aa0482365136f73b2 /drivers/video/fbdev | |
| parent | 5dadfa9238463612908c7e2f1872eb60f85668da (diff) | |
msm: mdss: flush retire work before ctl_stop operation
The vsync_retire worker registers for vsync_handler and
removes it when client requests power_off. It may
possible that vsync_handler is removed from list
through two different contexts. One from worker thread
and other from ctl_stop_sub call. Such race condition
can lead to list corruption. Ideally, ov_off should
wait for retire worker flush before calling ctl_stop
to avoid such race condition.
Change-Id: I7d68d67d1fe1df07e568a5f40db745ce155d7d14
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_overlay.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_overlay.c b/drivers/video/fbdev/msm/mdss_mdp_overlay.c index b2dd7f6c6e93..cc378bb8c69b 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_overlay.c +++ b/drivers/video/fbdev/msm/mdss_mdp_overlay.c @@ -4686,6 +4686,16 @@ static int mdss_mdp_overlay_off(struct msm_fb_data_type *mfd) msleep(vsync_time); __vsync_retire_signal(mfd, mdp5_data->retire_cnt); + + /* + * the retire work can still schedule after above retire_signal + * api call. Flush workqueue guarantees that current caller + * context is blocked till retire_work finishes. Any work + * schedule after flush call should not cause any issue because + * retire_signal api checks for retire_cnt with sync_mutex lock. + */ + + flush_work(&mdp5_data->retire_work); } ctl_stop: |
