]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/perf: riscv_pmu: Add riscv pmu pm notifier
authorEric Lin <eric.lin@sifive.com>
Tue, 5 Jul 2022 09:19:20 +0000 (17:19 +0800)
committerWill Deacon <will@kernel.org>
Wed, 6 Jul 2022 09:57:30 +0000 (10:57 +0100)
commitda4811f0b0f852ff0d9030d02f83c1c8e1355c69
treed32964f14942b5e6390e7af2e8dbe5caeca27b92
parentdcd572dcfd08af48fd985277949e7cc5e98306e4
drivers/perf: riscv_pmu: Add riscv pmu pm notifier

Currently, when the CPU is doing suspend to ram, we don't
save pmu counter register and its content will be lost.

To ensure perf profiling is not affected by suspend to ram,
this patch is based on arm_pmu CPU_PM notifier and implements riscv
pmu pm notifier. In the pm notifier, we stop the counter and update
the counter value before suspend and start the counter after resume.

Signed-off-by: Eric Lin <eric.lin@sifive.com>
Link: https://lore.kernel.org/r/20220705091920.27432-1-eric.lin@sifive.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/riscv_pmu.c
drivers/perf/riscv_pmu_sbi.c
include/linux/perf/riscv_pmu.h