Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f558d747 authored by Dhaval Patel's avatar Dhaval Patel
Browse files

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: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent bfbfa771
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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: