]> git.baikalelectronics.ru Git - kernel.git/commit
sparc: leon: Fix race condition between leon_cycles_offset and timer_interrupt
authorAndreas Larsson <andreas@gaisler.com>
Fri, 29 Aug 2014 15:09:18 +0000 (17:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Sep 2014 23:39:10 +0000 (16:39 -0700)
commit5e2263357d70ca82347b0e3b37f5edd5df6ed867
tree753e436fd62f5eae28fdc099d2d6a5d7e9ba6c46
parent144d85cb804ac6d44aab73b9af3b5660955f48b8
sparc: leon: Fix race condition between leon_cycles_offset and timer_interrupt

This makes sure that leon_cycles_offset takes the pending bit into
account and that leon_clear_clock_irq clears the pending bit. Otherwise,
if leon_cycles_offset is executed after the timer has wrapped but before
timer_interrupt has increased timer_cs_internal_counter, time can be
perceived to go backwards.

Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/leon_kernel.c