diff options
| author | Alexandre Ghiti <alexghiti@rivosinc.com> | 2025-03-18 12:59:08 +0000 |
|---|---|---|
| committer | Alexandre Ghiti <alexghiti@rivosinc.com> | 2025-03-18 12:59:08 +0000 |
| commit | a5edc510da314af336d1df133370a0608864e092 (patch) | |
| tree | c7c1ad23bbd23c42b57e020d9f80badf583a35c2 /drivers/clocksource | |
| parent | riscv: Simplify base extension checks and direct boolean return (diff) | |
| parent | clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug (diff) | |
| download | linux-a5edc510da314af336d1df133370a0608864e092.tar.gz linux-a5edc510da314af336d1df133370a0608864e092.zip | |
Merge patch series "Support SSTC while PM operations"
Nick Hu <nick.hu@sifive.com> says:
When the cpu is going to be hotplug, stop the stimecmp to prevent pending
interrupt.
When the cpu is going to be suspended, save the stimecmp before entering
the suspend state and restore it in the resume path.
* patches from https://lore.kernel.org/r/20250219114135.27764-1-nick.hu@sifive.com:
clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug
riscv: Add stimecmp save and restore
Link: https://lore.kernel.org/r/20250219114135.27764-1-nick.hu@sifive.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Diffstat (limited to 'drivers/clocksource')
| -rw-r--r-- | drivers/clocksource/timer-riscv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index 48ce50c5f5e6..4d7cf338824a 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -126,7 +126,13 @@ static int riscv_timer_starting_cpu(unsigned int cpu) static int riscv_timer_dying_cpu(unsigned int cpu) { + /* + * Stop the timer when the cpu is going to be offline otherwise + * the timer interrupt may be pending while performing power-down. + */ + riscv_clock_event_stop(); disable_percpu_irq(riscv_clock_event_irq); + return 0; } |
