summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorYicong Yang <yangyicong@hisilicon.com>2025-07-01 14:02:13 +0300
committerWill Deacon <will@kernel.org>2025-07-04 15:17:30 +0300
commit60bc47b5a0b164082d448815d7db3066266aa3ed (patch)
tree49037ceaa09b4317f10ba5a5c5139bd56f07b274 /include/linux
parent19272b37aa4f83ca52bdf9c16d5d81bdd1354494 (diff)
downloadlinux-60bc47b5a0b164082d448815d7db3066266aa3ed.tar.xz
watchdog/perf: Provide function for adjusting the event period
Architecture's using perf events for hard lockup detection needs to convert the watchdog_thresh to the event's period, some architecture for example arm64 perform this conversion using the CPU's maximum frequency which will be acquired by cpufreq. However by the time the lockup detector's initialized the cpufreq driver may not be initialized, thus launch a watchdog with inaccurate period. Provide a function hardlockup_detector_perf_adjust_period() to allowing adjust the event period. Then architecture can update with more accurate period if cpufreq is initialized. Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Link: https://lore.kernel.org/r/20250701110214.27242-2-yangyicong@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nmi.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/nmi.h b/include/linux/nmi.h
index e78fa535f61d..cf3c6ab408aa 100644
--- a/include/linux/nmi.h
+++ b/include/linux/nmi.h
@@ -103,10 +103,12 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs);
extern void hardlockup_detector_perf_stop(void);
extern void hardlockup_detector_perf_restart(void);
extern void hardlockup_config_perf_event(const char *str);
+extern void hardlockup_detector_perf_adjust_period(u64 period);
#else
static inline void hardlockup_detector_perf_stop(void) { }
static inline void hardlockup_detector_perf_restart(void) { }
static inline void hardlockup_config_perf_event(const char *str) { }
+static inline void hardlockup_detector_perf_adjust_period(u64 period) { }
#endif
void watchdog_hardlockup_stop(void);