m68k: hp300: Handle timer counter overflow
authorFinn Thain <fthain@telegraphics.com.au>
Sat, 1 Dec 2018 00:53:10 +0000 (11:53 +1100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 25 Mar 2019 09:22:24 +0000 (10:22 +0100)
commit4be2ba93cf2e7a7639e13605aebe0cd656ef9d93
treeb07ae9c0e3938e116f44bd7f4f4e17ed05c91bb7
parent2ed16626f58f88892864ed0cd68f841872ed1ca1
m68k: hp300: Handle timer counter overflow

Because hp300_read_clk() never checks the timer interrupt flag it may
fail to notice that the timer has wrapped, allowing the clock to jump
backwards. This is not a new problem.

This is resolved by checking the interrupt flag and, if need be,
taking wrap-around into account. The interrupt handler clears the flag
when it eventually executes.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/hp300/time.c