MIPS: cevt-r4k: Offset the value used to clear compare interrupt
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Mon, 27 Feb 2023 18:46:14 +0000 (18:46 +0000)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 27 Feb 2023 22:45:17 +0000 (23:45 +0100)
commit5ae7e037de566c3106c0fa951bbf35fd6370fdf6
tree11887ebe9492bdd26b7d3acc49d32a97f61a6039
parentfea8826d5fdc4ff5c93e883a738597129614039c
MIPS: cevt-r4k: Offset the value used to clear compare interrupt

In c0_compare_int_usable we clear compare interrupt by write value
just read out from counter to compare register.

However sometimes if those all instructions are graduated together
then it's possible that at the time compare register is written, the
counter haven't progressed, thus the interrupt is triggered again.

It also applies to QEMU that instructions is executed significantly
faster then counter.

Offset the value used to clear interrupt by one to prevent that happen.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/cevt-r4k.c