]> git.proxmox.com Git - qemu.git/commit
arm_timer: reload timer when enabled
authorRabin Vincent <rabin@rab.in>
Sun, 2 May 2010 09:50:51 +0000 (15:20 +0530)
committerAurelien Jarno <aurelien@aurel32.net>
Thu, 27 May 2010 13:52:52 +0000 (15:52 +0200)
commit72d3457e8d7c2e45d16acbc4b430c2cb566cedba
tree87114ced9782558290e72e92bd55b779a25c6e31
parente1f0c1d05d3f96c7471cca1a6991b63574e00b52
arm_timer: reload timer when enabled

Reload the timer when TimerControl is written, if the timer is to be
enabled.  Otherwise, if an earlier write to TimerLoad was done while
periodic mode was not set, s->delta may incorrectly still have the value
of the maximum limit instead of the value written to TimerLoad.

This problem is evident on versatileap on current linux-next, which
enables TIMER_CTRL_32BIT before writing to TimerLoad and then enabling
periodic mode and starting the timer.  This causes the first periodic
tick to be scheduled to occur after 0xffffffff periods, leading to a
perceived hang while the kernel waits for the first timer tick.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit d6759902cb467c002086853d2eb38fb969c29f7f)
hw/arm_timer.c