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)
commit384859d2af8ead22c9e5a570a4ab89f1b563c8e5
tree753e436fd62f5eae28fdc099d2d6a5d7e9ba6c46
parent74cad25c076a2f5253312c2fe82d1a4daecc1323
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