powerpc/time: Add set_state_oneshot_stopped decrementer callback
authorAnton Blanchard <anton@ozlabs.org>
Mon, 1 Oct 2018 23:01:05 +0000 (09:01 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 4 Oct 2018 13:00:31 +0000 (23:00 +1000)
If CONFIG_PPC_WATCHDOG is enabled we always cap the decrementer to
0x7fffffff:

       if (IS_ENABLED(CONFIG_PPC_WATCHDOG))
                set_dec(0x7fffffff);
        else
                set_dec(decrementer_max);

If there are no future events, we don't reprogram the decrementer
after this and we end up with 0x7fffffff even on a large decrementer
capable system.

As suggested by Nick, add a set_state_oneshot_stopped callback
so we program the decrementer with decrementer_max if there are
no future events.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/time.c

index 6a1f0a084ca350116c7fc1d4c9328fc270411ca4..40868f3ee113ab98c617dd4fb1e70eecce263acc 100644 (file)
@@ -111,6 +111,7 @@ struct clock_event_device decrementer_clockevent = {
        .rating                 = 200,
        .irq                    = 0,
        .set_next_event         = decrementer_set_next_event,
+       .set_state_oneshot_stopped = decrementer_shutdown,
        .set_state_shutdown     = decrementer_shutdown,
        .tick_resume            = decrementer_shutdown,
        .features               = CLOCK_EVT_FEAT_ONESHOT |