]> git.baikalelectronics.ru Git - kernel.git/commit
clockevents: Update clockevents device next_event on stop
authorPrasad Sodagudi <psodagud@codeaurora.org>
Thu, 26 Oct 2017 18:37:22 +0000 (11:37 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 1 Nov 2017 17:20:17 +0000 (18:20 +0100)
commitb8ef8bfd01c1107b22b45cdd145bc9c2ef6f53e7
treeef083fb7f9eef1b379c17f767315d7829d4b2c4e
parent730aef3058dd1db1b365e9b17f3d5a227e2cd949
clockevents: Update clockevents device next_event on stop

clockevent_device::next_event holds the next timer event of a clock event
device. The value is updated in clockevents_program_event(), i.e. when the
hardware timer is armed for the next expiry.

When there are no software timers armed on a CPU, the corresponding per CPU
clockevent device is brought into ONESHOT_STOPPED state, but
clockevent_device::next_event is not updated, because
clockevents_program_event() is not called.

So the content of clockevent_device::next_event is stale, which is not an
issue when real hardware is used. But the hrtimer broadcast device relies
on that information and the stale value causes spurious wakeups.

Update clockevent_device::next_event to KTIME_MAX when it has been brought
into ONESHOT_STOPPED state to avoid spurious wakeups. This reflects the
proper expiry time of the stopped timer: infinity.

[ tglx: Massaged changelog ]

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: viresh.kumar@linaro.org
Link: https://lkml.kernel.org/r/1509043042-32486-1-git-send-email-psodagud@codeaurora.org
kernel/time/tick-oneshot.c