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

Commit 4ea34303 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hrtimer: retain pinned state in timer->state"

parents 569a1dbb dde3a593
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));
}

/*