Skip to content

Commit 60c4687

Browse files
avpatelpalmer-dabbelt
authored andcommitted
clocksource: timer-riscv: Increase rating of clock_event_device for Sstc
When Sstc is available the RISC-V timer clock_event_device should be the preferred clock_event_device hence we increase clock_event_device rating for Sstc. 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-3-apatel@ventanamicro.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 5d98446 commit 60c4687

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/clocksource/timer-riscv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ static int riscv_timer_starting_cpu(unsigned int cpu)
105105
ce->irq = riscv_clock_event_irq;
106106
if (riscv_timer_cannot_wake_cpu)
107107
ce->features |= CLOCK_EVT_FEAT_C3STOP;
108+
if (static_branch_likely(&riscv_sstc_available))
109+
ce->rating = 450;
108110
clockevents_config_and_register(ce, riscv_timebase, 100, 0x7fffffff);
109111

110112
enable_percpu_irq(riscv_clock_event_irq,

0 commit comments

Comments
 (0)