]> git.karo-electronics.de Git - karo-tx-linux.git/commit
m68knommu: fix broken ColdFire slice timer read_clk() code
authorGreg Ungerer <gerg@uclinux.org>
Wed, 16 Nov 2011 05:09:02 +0000 (15:09 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Fri, 2 Dec 2011 01:31:31 +0000 (11:31 +1000)
commitacf1714f7694ffdc70fd9fc5c303eacbf4e31a0d
tree07b1e3ffada1d7a78aedbb5988ad21c9e3ff9c1b
parentbdccf7fac47a050b1cbedd53a8a9bfe1d8aae820
m68knommu: fix broken ColdFire slice timer read_clk() code

There is a race on reading the ColdFire slice timer current count and the
total clock count so far. Interrupts are off, and we may have just missed
getting a new timer wrap event interrupt. Check for this and adjust the
cycle count and current read count accordingly.

Also the slice timer counts down from the terminal count. So in read_clk()
we need take the current clock count away from the terminal count.

Reported-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/platform/coldfire/sltimers.c