aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel/time.c')
-rw-r--r--arch/parisc/kernel/time.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 4b8fd6dc22da..f7e684560186 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -76,10 +76,10 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
76 next_tick = cpuinfo->it_value; 76 next_tick = cpuinfo->it_value;
77 77
78 /* Calculate how many ticks have elapsed. */ 78 /* Calculate how many ticks have elapsed. */
79 now = mfctl(16);
79 do { 80 do {
80 ++ticks_elapsed; 81 ++ticks_elapsed;
81 next_tick += cpt; 82 next_tick += cpt;
82 now = mfctl(16);
83 } while (next_tick - now > cpt); 83 } while (next_tick - now > cpt);
84 84
85 /* Store (in CR16 cycles) up to when we are accounting right now. */ 85 /* Store (in CR16 cycles) up to when we are accounting right now. */
@@ -103,16 +103,17 @@ irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
103 * if one or the other wrapped. If "now" is "bigger" we'll end up 103 * if one or the other wrapped. If "now" is "bigger" we'll end up
104 * with a very large unsigned number. 104 * with a very large unsigned number.
105 */ 105 */
106 while (next_tick - mfctl(16) > cpt) 106 now = mfctl(16);
107 while (next_tick - now > cpt)
107 next_tick += cpt; 108 next_tick += cpt;
108 109
109 /* Program the IT when to deliver the next interrupt. 110 /* Program the IT when to deliver the next interrupt.
110 * Only bottom 32-bits of next_tick are writable in CR16! 111 * Only bottom 32-bits of next_tick are writable in CR16!
111 * Timer interrupt will be delivered at least a few hundred cycles 112 * Timer interrupt will be delivered at least a few hundred cycles
112 * after the IT fires, so if we are too close (<= 500 cycles) to the 113 * after the IT fires, so if we are too close (<= 8000 cycles) to the
113 * next cycle, simply skip it. 114 * next cycle, simply skip it.
114 */ 115 */
115 if (next_tick - mfctl(16) <= 500) 116 if (next_tick - now <= 8000)
116 next_tick += cpt; 117 next_tick += cpt;
117 mtctl(next_tick, 16); 118 mtctl(next_tick, 16);
118 119
@@ -248,7 +249,7 @@ static int __init init_cr16_clocksource(void)
248 * different sockets, so mark them unstable and lower rating on 249 * different sockets, so mark them unstable and lower rating on
249 * multi-socket SMP systems. 250 * multi-socket SMP systems.
250 */ 251 */
251 if (num_online_cpus() > 1) { 252 if (num_online_cpus() > 1 && !running_on_qemu) {
252 int cpu; 253 int cpu;
253 unsigned long cpu0_loc; 254 unsigned long cpu0_loc;
254 cpu0_loc = per_cpu(cpu_data, 0).cpu_loc; 255 cpu0_loc = per_cpu(cpu_data, 0).cpu_loc;