Skip to content

Commit 6a902b1

Browse files
Joshua Yeongdlezcano
authored andcommitted
clocksource/timer-riscv: Add riscv_clock_shutdown callback
Add clocksource detach/shutdown callback to disable RISC-V timer interrupt when switching out riscv timer as clock source Signed-off-by: Joshua Yeong <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e0cf601 commit 6a902b1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/clocksource/timer-riscv.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,19 @@ static int riscv_clock_next_event(unsigned long delta,
6161
return 0;
6262
}
6363

64+
static int riscv_clock_shutdown(struct clock_event_device *evt)
65+
{
66+
riscv_clock_event_stop();
67+
return 0;
68+
}
69+
6470
static unsigned int riscv_clock_event_irq;
6571
static DEFINE_PER_CPU(struct clock_event_device, riscv_clock_event) = {
6672
.name = "riscv_timer_clockevent",
6773
.features = CLOCK_EVT_FEAT_ONESHOT,
6874
.rating = 100,
6975
.set_next_event = riscv_clock_next_event,
76+
.set_state_shutdown = riscv_clock_shutdown,
7077
};
7178

7279
/*

0 commit comments

Comments
 (0)