Currently tick_program_event function is not calling
clockevents_program_event when  'expires == KTIME_MAX',
it is just updating clockevent state to CLOCK_EVT_STATE_ONESHOT_STOPPED.
clockevents_program_event function updates clockevent
device next_event by checking clockevent device state,
so always call clockevents_program_event() from tick_program_event.

Signed-off-by: Prasad Sodagudi <psoda...@codeaurora.org>
---
 kernel/time/tick-oneshot.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c
index 6b009c2..650b071 100644
--- a/kernel/time/tick-oneshot.c
+++ b/kernel/time/tick-oneshot.c
@@ -28,15 +28,12 @@ int tick_program_event(ktime_t expires, int force)
 {
        struct clock_event_device *dev = 
__this_cpu_read(tick_cpu_device.evtdev);
 
-       if (unlikely(expires == KTIME_MAX)) {
+       if (expires == KTIME_MAX) {
                /*
                 * We don't need the clock event device any more, stop it.
                 */
                clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED);
-               return 0;
-       }
-
-       if (unlikely(clockevent_state_oneshot_stopped(dev))) {
+       } else if (clockevent_state_oneshot_stopped(dev)) {
                /*
                 * We need the clock event again, configure it in ONESHOT mode
                 * before using it.
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Reply via email to