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

Commit 386cda91 authored by Abinaya P's avatar Abinaya P
Browse files

msm: qpnp-haptic: cancel polling timer before starting a new timer



To handle concurrent requests, cancel the previous instance of the
polling timer just before starting a new instance of the same timer
in order to avoid concurrent access to hrtimer apis.

Change-Id: Ia424da65288666857d6f99d4b543a99434536396
Signed-off-by: default avatarAbinaya P <abinayap@codeaurora.org>
parent aab2ad6e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1510,6 +1510,7 @@ static int qpnp_hap_set(struct qpnp_hap *hap, int on)
				 * Start timer to poll Auto Resonance error bit
				 */
				mutex_lock(&hap->lock);
				hrtimer_cancel(&hap->auto_res_err_poll_timer);
				hrtimer_start(&hap->auto_res_err_poll_timer,
						ktime_set(0, timeout_ns),
						 HRTIMER_MODE_REL);