clocksource: timer-riscv: Don't enable/disable timer interrupt
authorAnup Patel <apatel@ventanamicro.com>
Mon, 10 Jul 2023 13:19:01 +0000 (18:49 +0530)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 1 Nov 2023 02:15:48 +0000 (19:15 -0700)
commit5d98446f03c622cb917e15a5561601587c64aab2
tree2fe485cdec9a3858c756d7fa704749342a993b64
parenta9429d5f99bc25885ba5d4c2c58a25467f5d741b
clocksource: timer-riscv: Don't enable/disable timer interrupt

Currently, we enable/disable timer interrupt at runtime to start/stop
timer events. This makes timer interrupt state go out-of-sync with
the Linux interrupt subsystem.

To address the above issue, we can stop a per-HART timer interrupt
by setting U64_MAX in timecmp CSR (or sbi_set_timer()) at the time
of handling timer interrupt.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20230710131902.1459180-2-apatel@ventanamicro.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/clocksource/timer-riscv.c