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

Commit dde3a593 authored by Srinivasarao P's avatar Srinivasarao P Committed by Gerrit - the friendly Code Review server
Browse files

hrtimer: retain pinned state in timer->state



hrtimer pinned state not retained due to changes in commit
c30521f5 "Merge android-4.9.208(9759f952) into msm-4.9"
fixing it by retaining pinned state in timer->state.

Change-Id: I75c12bc924087bb40bdd6aac611182c399afdc86
Signed-off-by: default avatarSrinivasarao P <spathi@codeaurora.org>
parent cf699526
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -845,7 +845,7 @@ static int enqueue_hrtimer(struct hrtimer *timer,
	base->cpu_base->active_bases |= 1 << base->index;

	/* Pairs with the lockless read in hrtimer_is_queued() */
	WRITE_ONCE(timer->state, HRTIMER_STATE_ENQUEUED);
	WRITE_ONCE(timer->state, timer->state | HRTIMER_STATE_ENQUEUED);

	return timerqueue_add(&base->active, &timer->node);
}
@@ -865,12 +865,9 @@ static void __remove_hrtimer(struct hrtimer *timer,
			     u8 newstate, int reprogram)
{
	struct hrtimer_cpu_base *cpu_base = base->cpu_base;
	unsigned int state = timer->state;

	if (!(state & HRTIMER_STATE_ENQUEUED))
	if (!(timer->state & HRTIMER_STATE_ENQUEUED))
		goto out;
	/* Pairs with the lockless read in hrtimer_is_queued() */
	WRITE_ONCE(timer->state, newstate);

	if (!timerqueue_del(&base->active, &timer->node))
		cpu_base->active_bases &= ~(1 << base->index);
@@ -893,7 +890,9 @@ static void __remove_hrtimer(struct hrtimer *timer,
	* We need to preserve PINNED state here, otherwise we may end up
	* migrating pinned hrtimers as well.
	*/
	timer->state = newstate | (timer->state & HRTIMER_STATE_PINNED);
	/* Pairs with the lockless read in hrtimer_is_queued() */
	WRITE_ONCE(timer->state,
		   newstate | (timer->state & HRTIMER_STATE_PINNED));
}

/*