clocksource/drivers/riscv: Increase the clock source rating
authorSamuel Holland <samuel@sholland.org>
Wed, 28 Dec 2022 00:44:44 +0000 (18:44 -0600)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 13 Feb 2023 12:10:16 +0000 (13:10 +0100)
commit674402b0098b66b8ba91fe93c0d27af703256098
tree1ab249b6d78c1c0b5c921ff8b2687644e238c6ae
parent8932a9533a9cdd1fa2924a061dc87277991507ca
clocksource/drivers/riscv: Increase the clock source rating

RISC-V provides an architectural clock source via the time CSR. This
clock source exposes a 64-bit counter synchronized across all CPUs.
Because it is accessed using a CSR, it is much more efficient to read
than MMIO clock sources. For example, on the Allwinner D1, reading the
sun4i timer in a loop takes 131 cycles/iteration, while reading the
RISC-V time CSR takes only 5 cycles/iteration.

Adjust the RISC-V clock source rating so it is preferred over the
various platform-specific MMIO clock sources.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20221228004444.61568-1-samuel@sholland.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
drivers/clocksource/timer-riscv.c