Unverified Commit aeac9c02 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7165 v2 tick/broadcast-hrtimer: Prevent the timer device on broadcast duty...

!7165 v2  tick/broadcast-hrtimer: Prevent the timer device on broadcast duty CPU from being disabled

Merge Pull Request from: @ci-robot 
 
PR sync from: Yu Liao <liaoyu15@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/YXKTCNRKK542NCLCSK3TO7I4BML3ASWU/ 
 
https://gitee.com/openeuler/kernel/issues/I8PL17 
 
Link:https://gitee.com/openeuler/kernel/pulls/7165

 

Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 704b1fb9 1dd6f097
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -42,6 +42,19 @@ static int bc_shutdown(struct clock_event_device *evt)
 */
static int bc_set_next(ktime_t expires, struct clock_event_device *bc)
{
	struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);

	/*
	 * This can be called from CPU offline operation to move broadcast
	 * assignment. If tick_broadcast_force_mask is set, the CPU local
	 * timer device may be disabled. And hrtimer_reprogram() will not
	 * called if the timer is not the first expiring timer. Reprogram
	 * the cpu local timer device to ensure we can take over the
	 * broadcast duty.
	 */
	if (tick_check_broadcast_expired() && expires >= dev->next_event)
		clockevents_program_event(dev, dev->next_event, 1);

	/*
	 * This is called either from enter/exit idle code or from the
	 * broadcast handler. In all cases tick_broadcast_lock is held.