diff options
Diffstat (limited to 'arch/sparc64/kernel/time.c')
-rw-r--r-- | arch/sparc64/kernel/time.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c index b40db389f90b..362b9c26871b 100644 --- a/arch/sparc64/kernel/time.c +++ b/arch/sparc64/kernel/time.c | |||
@@ -73,7 +73,7 @@ static __initdata struct sparc64_tick_ops dummy_tick_ops = { | |||
73 | .get_tick = dummy_get_tick, | 73 | .get_tick = dummy_get_tick, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | struct sparc64_tick_ops *tick_ops = &dummy_tick_ops; | 76 | struct sparc64_tick_ops *tick_ops __read_mostly = &dummy_tick_ops; |
77 | 77 | ||
78 | #define TICK_PRIV_BIT (1UL << 63) | 78 | #define TICK_PRIV_BIT (1UL << 63) |
79 | 79 | ||
@@ -195,7 +195,7 @@ static unsigned long tick_add_tick(unsigned long adj, unsigned long offset) | |||
195 | return new_tick; | 195 | return new_tick; |
196 | } | 196 | } |
197 | 197 | ||
198 | static struct sparc64_tick_ops tick_operations = { | 198 | static struct sparc64_tick_ops tick_operations __read_mostly = { |
199 | .init_tick = tick_init_tick, | 199 | .init_tick = tick_init_tick, |
200 | .get_tick = tick_get_tick, | 200 | .get_tick = tick_get_tick, |
201 | .get_compare = tick_get_compare, | 201 | .get_compare = tick_get_compare, |
@@ -276,7 +276,7 @@ static unsigned long stick_add_compare(unsigned long adj) | |||
276 | return new_compare; | 276 | return new_compare; |
277 | } | 277 | } |
278 | 278 | ||
279 | static struct sparc64_tick_ops stick_operations = { | 279 | static struct sparc64_tick_ops stick_operations __read_mostly = { |
280 | .init_tick = stick_init_tick, | 280 | .init_tick = stick_init_tick, |
281 | .get_tick = stick_get_tick, | 281 | .get_tick = stick_get_tick, |
282 | .get_compare = stick_get_compare, | 282 | .get_compare = stick_get_compare, |
@@ -422,7 +422,7 @@ static unsigned long hbtick_add_compare(unsigned long adj) | |||
422 | return val; | 422 | return val; |
423 | } | 423 | } |
424 | 424 | ||
425 | static struct sparc64_tick_ops hbtick_operations = { | 425 | static struct sparc64_tick_ops hbtick_operations __read_mostly = { |
426 | .init_tick = hbtick_init_tick, | 426 | .init_tick = hbtick_init_tick, |
427 | .get_tick = hbtick_get_tick, | 427 | .get_tick = hbtick_get_tick, |
428 | .get_compare = hbtick_get_compare, | 428 | .get_compare = hbtick_get_compare, |
@@ -437,10 +437,9 @@ static struct sparc64_tick_ops hbtick_operations = { | |||
437 | * NOTE: On SUN5 systems the ticker interrupt comes in using 2 | 437 | * NOTE: On SUN5 systems the ticker interrupt comes in using 2 |
438 | * interrupts, one at level14 and one with softint bit 0. | 438 | * interrupts, one at level14 and one with softint bit 0. |
439 | */ | 439 | */ |
440 | unsigned long timer_tick_offset; | 440 | unsigned long timer_tick_offset __read_mostly; |
441 | unsigned long timer_tick_compare; | ||
442 | 441 | ||
443 | static unsigned long timer_ticks_per_nsec_quotient; | 442 | static unsigned long timer_ticks_per_nsec_quotient __read_mostly; |
444 | 443 | ||
445 | #define TICK_SIZE (tick_nsec / 1000) | 444 | #define TICK_SIZE (tick_nsec / 1000) |
446 | 445 | ||
@@ -464,7 +463,7 @@ static inline void timer_check_rtc(void) | |||
464 | 463 | ||
465 | static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) | 464 | static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) |
466 | { | 465 | { |
467 | unsigned long ticks, pstate; | 466 | unsigned long ticks, compare, pstate; |
468 | 467 | ||
469 | write_seqlock(&xtime_lock); | 468 | write_seqlock(&xtime_lock); |
470 | 469 | ||
@@ -483,14 +482,14 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) | |||
483 | : "=r" (pstate) | 482 | : "=r" (pstate) |
484 | : "i" (PSTATE_IE)); | 483 | : "i" (PSTATE_IE)); |
485 | 484 | ||
486 | timer_tick_compare = tick_ops->add_compare(timer_tick_offset); | 485 | compare = tick_ops->add_compare(timer_tick_offset); |
487 | ticks = tick_ops->get_tick(); | 486 | ticks = tick_ops->get_tick(); |
488 | 487 | ||
489 | /* Restore PSTATE_IE. */ | 488 | /* Restore PSTATE_IE. */ |
490 | __asm__ __volatile__("wrpr %0, 0x0, %%pstate" | 489 | __asm__ __volatile__("wrpr %0, 0x0, %%pstate" |
491 | : /* no outputs */ | 490 | : /* no outputs */ |
492 | : "r" (pstate)); | 491 | : "r" (pstate)); |
493 | } while (time_after_eq(ticks, timer_tick_compare)); | 492 | } while (time_after_eq(ticks, compare)); |
494 | 493 | ||
495 | timer_check_rtc(); | 494 | timer_check_rtc(); |
496 | 495 | ||
@@ -506,11 +505,6 @@ void timer_tick_interrupt(struct pt_regs *regs) | |||
506 | 505 | ||
507 | do_timer(regs); | 506 | do_timer(regs); |
508 | 507 | ||
509 | /* | ||
510 | * Only keep timer_tick_offset uptodate, but don't set TICK_CMPR. | ||
511 | */ | ||
512 | timer_tick_compare = tick_ops->get_compare() + timer_tick_offset; | ||
513 | |||
514 | timer_check_rtc(); | 508 | timer_check_rtc(); |
515 | 509 | ||
516 | write_sequnlock(&xtime_lock); | 510 | write_sequnlock(&xtime_lock); |