Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73316
b: refs/heads/master
c: 43875cc
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed Nov 8, 2007
1 parent a521788 commit 8e7f00e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 465ccab9eb8209a2a402710b24a9bff127b25b94
refs/heads/master: 43875cc0a54d936132010e58545269e183741fae
10 changes: 3 additions & 7 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ void timer_interrupt(struct pt_regs * regs)
/* not time for this event yet */
now = per_cpu(decrementer_next_tb, cpu) - now;
if (now <= DECREMENTER_MAX)
set_dec((unsigned int)now - 1);
set_dec((int)now);
return;
}
old_regs = set_irq_regs(regs);
Expand All @@ -611,8 +611,6 @@ void timer_interrupt(struct pt_regs * regs)

if (evt->event_handler)
evt->event_handler(evt);
else
evt->set_next_event(DECREMENTER_MAX, evt);

#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
Expand Down Expand Up @@ -836,9 +834,6 @@ static int decrementer_set_next_event(unsigned long evt,
struct clock_event_device *dev)
{
__get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
/* The decrementer interrupts on the 0 -> -1 transition */
if (evt)
--evt;
set_dec(evt);
return 0;
}
Expand Down Expand Up @@ -871,7 +866,8 @@ void init_decrementer_clockevent(void)
decrementer_clockevent.shift);
decrementer_clockevent.max_delta_ns =
clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
decrementer_clockevent.min_delta_ns = 1000;
decrementer_clockevent.min_delta_ns =
clockevent_delta2ns(2, &decrementer_clockevent);

register_decrementer_clockevent(cpu);
}
Expand Down
20 changes: 13 additions & 7 deletions trunk/include/asm-powerpc/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,25 +176,31 @@ static inline unsigned int get_dec(void)
#endif
}

/*
* Note: Book E and 4xx processors differ from other PowerPC processors
* in when the decrementer generates its interrupt: on the 1 to 0
* transition for Book E/4xx, but on the 0 to -1 transition for others.
*/
static inline void set_dec(int val)
{
#if defined(CONFIG_40x)
mtspr(SPRN_PIT, val);
#elif defined(CONFIG_8xx_CPU6)
set_dec_cpu6(val);
set_dec_cpu6(val - 1);
#else
#ifndef CONFIG_BOOKE
--val;
#endif
#ifdef CONFIG_PPC_ISERIES
int cur_dec;

if (firmware_has_feature(FW_FEATURE_ISERIES) &&
get_lppaca()->shared_proc) {
get_lppaca()->virtual_decr = val;
cur_dec = get_dec();
if (cur_dec > val)
if (get_dec() > val)
HvCall_setVirtualDecr();
} else
return;
}
#endif
mtspr(SPRN_DEC, val);
mtspr(SPRN_DEC, val);
#endif /* not 40x or 8xx_CPU6 */
}

Expand Down

0 comments on commit 8e7f00e

Please sign in to comment.