diff options
author | Paul Mackerras <paulus@samba.org> | 2007-09-19 20:09:27 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-09-19 20:09:27 -0400 |
commit | 0ce49a3945474fc942ec37c0c0efece60f592f80 (patch) | |
tree | f42b821b2d9e2d8775bc22f56d444c2cc7b7b7dd /arch/powerpc | |
parent | 9e4859ef5462193643fd2b3c8ffb298e5a4a4319 (diff) | |
parent | a88a8eff1e6e32d3288986a9d36c6a449c032d3a (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/time.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/vdso.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 4 |
3 files changed, 19 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index b5944d8e3802..d95e68c0a6b3 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -238,7 +238,7 @@ static void snapshot_tb_and_purr(void *data) | |||
238 | struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); | 238 | struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); |
239 | 239 | ||
240 | local_irq_save(flags); | 240 | local_irq_save(flags); |
241 | p->tb = mftb(); | 241 | p->tb = get_tb_or_rtc(); |
242 | p->purr = mfspr(SPRN_PURR); | 242 | p->purr = mfspr(SPRN_PURR); |
243 | wmb(); | 243 | wmb(); |
244 | p->initialized = 1; | 244 | p->initialized = 1; |
@@ -316,7 +316,7 @@ static void snapshot_purr(void) | |||
316 | */ | 316 | */ |
317 | void snapshot_timebase(void) | 317 | void snapshot_timebase(void) |
318 | { | 318 | { |
319 | __get_cpu_var(last_jiffy) = get_tb(); | 319 | __get_cpu_var(last_jiffy) = get_tb_or_rtc(); |
320 | snapshot_purr(); | 320 | snapshot_purr(); |
321 | } | 321 | } |
322 | 322 | ||
@@ -683,6 +683,8 @@ void timer_interrupt(struct pt_regs * regs) | |||
683 | 683 | ||
684 | write_seqlock(&xtime_lock); | 684 | write_seqlock(&xtime_lock); |
685 | tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy; | 685 | tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy; |
686 | if (__USE_RTC() && tb_next_jiffy >= 1000000000) | ||
687 | tb_next_jiffy -= 1000000000; | ||
686 | if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) { | 688 | if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) { |
687 | tb_last_jiffy = tb_next_jiffy; | 689 | tb_last_jiffy = tb_next_jiffy; |
688 | do_timer(1); | 690 | do_timer(1); |
@@ -976,7 +978,7 @@ void __init time_init(void) | |||
976 | tb_to_ns_scale = scale; | 978 | tb_to_ns_scale = scale; |
977 | tb_to_ns_shift = shift; | 979 | tb_to_ns_shift = shift; |
978 | /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */ | 980 | /* Save the current timebase to pretty up CONFIG_PRINTK_TIME */ |
979 | boot_tb = get_tb(); | 981 | boot_tb = get_tb_or_rtc(); |
980 | 982 | ||
981 | tm = get_boot_time(); | 983 | tm = get_boot_time(); |
982 | 984 | ||
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index cef01e4e8989..213fa31ac537 100644 --- a/arch/powerpc/kernel/vdso.c +++ b/arch/powerpc/kernel/vdso.c | |||
@@ -98,6 +98,18 @@ static struct vdso_patch_def vdso_patches[] = { | |||
98 | CPU_FTR_USE_TB, 0, | 98 | CPU_FTR_USE_TB, 0, |
99 | "__kernel_gettimeofday", NULL | 99 | "__kernel_gettimeofday", NULL |
100 | }, | 100 | }, |
101 | { | ||
102 | CPU_FTR_USE_TB, 0, | ||
103 | "__kernel_clock_gettime", NULL | ||
104 | }, | ||
105 | { | ||
106 | CPU_FTR_USE_TB, 0, | ||
107 | "__kernel_clock_getres", NULL | ||
108 | }, | ||
109 | { | ||
110 | CPU_FTR_USE_TB, 0, | ||
111 | "__kernel_get_tbfreq", NULL | ||
112 | }, | ||
101 | }; | 113 | }; |
102 | 114 | ||
103 | /* | 115 | /* |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 17806e001e50..4d257b3f9336 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -594,7 +594,7 @@ static struct spu *find_victim(struct spu_context *ctx) | |||
594 | list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) { | 594 | list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list) { |
595 | struct spu_context *tmp = spu->ctx; | 595 | struct spu_context *tmp = spu->ctx; |
596 | 596 | ||
597 | if (tmp->prio > ctx->prio && | 597 | if (tmp && tmp->prio > ctx->prio && |
598 | (!victim || tmp->prio > victim->prio)) | 598 | (!victim || tmp->prio > victim->prio)) |
599 | victim = spu->ctx; | 599 | victim = spu->ctx; |
600 | } | 600 | } |
@@ -626,9 +626,9 @@ static struct spu *find_victim(struct spu_context *ctx) | |||
626 | 626 | ||
627 | mutex_lock(&cbe_spu_info[node].list_mutex); | 627 | mutex_lock(&cbe_spu_info[node].list_mutex); |
628 | cbe_spu_info[node].nr_active--; | 628 | cbe_spu_info[node].nr_active--; |
629 | spu_unbind_context(spu, victim); | ||
629 | mutex_unlock(&cbe_spu_info[node].list_mutex); | 630 | mutex_unlock(&cbe_spu_info[node].list_mutex); |
630 | 631 | ||
631 | spu_unbind_context(spu, victim); | ||
632 | victim->stats.invol_ctx_switch++; | 632 | victim->stats.invol_ctx_switch++; |
633 | spu->stats.invol_ctx_switch++; | 633 | spu->stats.invol_ctx_switch++; |
634 | mutex_unlock(&victim->state_mutex); | 634 | mutex_unlock(&victim->state_mutex); |