Skip to content
Commit 79d076be authored by Huifeng Zhang's avatar Huifeng Zhang Committed by Carles Cufí
Browse files

drivers: timer: arm_arch_timer: Fix round up issue



Fast hardware with slow timer hardware can trigger and enter an
interrupt and reach 'sys_clock_set_timeout' before the counter has
advanced.

That defeats the "round up" logic such that we end up scheduling
timeouts a tick too soon (e.g. if the kernel requests an interrupt
at the "X" tick, we would end up computing a comparator value
representing the "X-1" tick!).

Choose the bigger one between 1 and "curr_cycle - last_cycle" to
correct.

Signed-off-by: default avatarHuifeng Zhang <Huifeng.Zhang@arm.com>
parent 522e0b5a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment