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

Commit 4a93232d authored by Venki Pallipadi's avatar Venki Pallipadi Committed by Thomas Gleixner
Browse files

clock events: allow replacement of broadcast timer



Change the broadcast timer, if a timer with higher rating becomes available.

Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 31c435d7
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -64,7 +64,8 @@ static void tick_broadcast_start_periodic(struct clock_event_device *bc)
 */
int tick_check_broadcast_device(struct clock_event_device *dev)
{
	if (tick_broadcast_device.evtdev ||
	if ((tick_broadcast_device.evtdev &&
	     tick_broadcast_device.evtdev->rating >= dev->rating) ||
	     (dev->features & CLOCK_EVT_FEAT_C3STOP))
		return 0;

@@ -513,12 +514,10 @@ static void tick_broadcast_clear_oneshot(int cpu)
 */
void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
{
	if (bc->mode != CLOCK_EVT_MODE_ONESHOT) {
	bc->event_handler = tick_handle_oneshot_broadcast;
	clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
	bc->next_event.tv64 = KTIME_MAX;
}
}

/*
 * Select oneshot operating mode for the broadcast device
+2 −2
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)

	cpu = smp_processor_id();
	if (!cpu_isset(cpu, newdev->cpumask))
		goto out;
		goto out_bc;

	td = &per_cpu(tick_cpu_device, cpu);
	curdev = td->evtdev;
@@ -265,7 +265,7 @@ static int tick_check_new_device(struct clock_event_device *newdev)
	 */
	if (tick_check_broadcast_device(newdev))
		ret = NOTIFY_STOP;
out:

	spin_unlock_irqrestore(&tick_device_lock, flags);

	return ret;