Skip to content

Commit 2b49ddc

Browse files
committed
ia64: convert to legacy_timer_tick
ia64 is the only architecture that calls xtime_update() in a loop, once for each jiffie that has passed since the last event. Before commit 3171a03 ("[PATCH] simplify update_times (avoid jiffies/jiffies_64 aliasing problem)") in 2006, it could not actually do this any differently, but now it seems simpler to just pass the number of jiffies that passed in the meantime. While this loses the ability process interrupts in the middle of the timer tick by calling local_irq_enable(), doing so is fairly peculiar anyway and it seems better to just do what everyone else does here. Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent b355016 commit 2b49ddc

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

arch/ia64/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ config IA64
4646
select ARCH_THREAD_STACK_ALLOCATOR
4747
select ARCH_CLOCKSOURCE_DATA
4848
select GENERIC_TIME_VSYSCALL
49+
select LEGACY_TIMER_TICK
4950
select SWIOTLB
5051
select SYSCTL_ARCH_UNALIGN_NO_WARN
5152
select HAVE_MOD_ARCH_SPECIFIC

arch/ia64/kernel/time.c

+13-23
Original file line numberDiff line numberDiff line change
@@ -161,39 +161,29 @@ void vtime_account_idle(struct task_struct *tsk)
161161
static irqreturn_t
162162
timer_interrupt (int irq, void *dev_id)
163163
{
164-
unsigned long new_itm;
164+
unsigned long cur_itm, new_itm, ticks;
165165

166166
if (cpu_is_offline(smp_processor_id())) {
167167
return IRQ_HANDLED;
168168
}
169169

170170
new_itm = local_cpu_data->itm_next;
171+
cur_itm = ia64_get_itc();
171172

172-
if (!time_after(ia64_get_itc(), new_itm))
173+
if (!time_after(cur_itm, new_itm)) {
173174
printk(KERN_ERR "Oops: timer tick before it's due (itc=%lx,itm=%lx)\n",
174-
ia64_get_itc(), new_itm);
175-
176-
profile_tick(CPU_PROFILING);
177-
178-
while (1) {
179-
update_process_times(user_mode(get_irq_regs()));
180-
181-
new_itm += local_cpu_data->itm_delta;
182-
183-
if (smp_processor_id() == time_keeper_id)
184-
xtime_update(1);
185-
186-
local_cpu_data->itm_next = new_itm;
175+
cur_itm, new_itm);
176+
ticks = 1;
177+
} else {
178+
ticks = DIV_ROUND_UP(cur_itm - new_itm,
179+
local_cpu_data->itm_delta);
180+
new_itm += ticks * local_cpu_data->itm_delta;
181+
}
187182

188-
if (time_after(new_itm, ia64_get_itc()))
189-
break;
183+
if (smp_processor_id() != time_keeper_id)
184+
ticks = 0;
190185

191-
/*
192-
* Allow IPIs to interrupt the timer loop.
193-
*/
194-
local_irq_enable();
195-
local_irq_disable();
196-
}
186+
legacy_timer_tick(ticks);
197187

198188
do {
199189
/*

0 commit comments

Comments
 (0)