[lkml]   [2007]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 2.6.21-rt7] PowerPC: fix clockevents for classic CPUs
    Uncoditionally set a maximum positive value to the decrementer before calling
    an event handler for all "classic" PPC CPUs (although this is only necessary
    to clear interrupt on POWER4+, I've been asked to do it this way) -- otherwise
    it wouldn't have been done for an offline CPU in periodic mode since the event
    reprogramming has been delegated to the timer subsystem.
    Also, as the classic decrementer doesn't have periodic mode, make set_mode()
    method for this case completely empty.
    While at it, add a switch case for CLOCK_EVT_MODE_RESUME to hush the warning.

    Signed-off-by: Sergei Shtylyov <>

    Testing on "classic" CPUs is still needed (used to work atop of 2.6.18-rt7).

    arch/powerpc/kernel/time.c | 15 +++++++--------
    1 files changed, 7 insertions(+), 8 deletions(-)

    Index: linux-2.6/arch/powerpc/kernel/time.c
    --- linux-2.6.orig/arch/powerpc/kernel/time.c
    +++ linux-2.6/arch/powerpc/kernel/time.c
    @@ -166,11 +166,14 @@ static void decrementer_set_mode(enum cl
    tcr &= ~TCR_DIE;
    + break;
    mtspr(SPRN_TCR, tcr);
    if (mode == CLOCK_EVT_MODE_PERIODIC)
    decrementer_set_next_event(tb_ticks_per_jiffy, dev);

    static struct clock_event_device decrementer_clockevent = {
    @@ -549,16 +552,12 @@ void timer_interrupt(struct pt_regs * re

    +#if !defined(CONFIG_40x) && !defined(CONFIG_BOOKE)
    * We must write a positive value to the decrementer to clear
    - * the interrupt on the IBM 970 CPU series. In periodic mode,
    - * this happens when the decrementer gets reloaded later, but
    - * in one-shot mode, we have to do it here since an event handler
    - * may skip loading the new value...
    + * the interrupt on POWER4+ compatible CPUs.
    - if (per_cpu(decrementers, cpu).mode != CLOCK_EVT_MODE_PERIODIC)
    - set_dec(DECREMENTER_MAX);
    + set_dec(DECREMENTER_MAX);
    * We can't disable the decrementer, so in the period between
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2007-05-24 20:27    [W:0.022 / U:6.792 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site