diff --git a/arch/arm64/kernel/watchdog_sdei.c b/arch/arm64/kernel/watchdog_sdei.c index 874d51363f6c319f9e7e8ba5b5051c6b8d8d5c83..4fd1419729c2c37bef1879dc08413158d9b4b056 100644 --- a/arch/arm64/kernel/watchdog_sdei.c +++ b/arch/arm64/kernel/watchdog_sdei.c @@ -26,6 +26,8 @@ int watchdog_nmi_enable(unsigned int cpu) { int ret; + refresh_hld_last_timestamp(); + ret = sdei_api_event_enable(sdei_watchdog_event_num); if (ret) { pr_err("Enable NMI Watchdog failed on cpu%d\n", diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 9ce94235a05f1009255fb8947a45773a0dc927b9..f65cfbb5d46cc8e4c8e4975ca27dbe667dfd4ceb 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -204,6 +204,7 @@ u64 hw_nmi_get_sample_period(int watchdog_thresh); #if defined(CONFIG_HARDLOCKUP_CHECK_TIMESTAMP) && \ defined(CONFIG_HARDLOCKUP_DETECTOR) void watchdog_update_hrtimer_threshold(u64 period); +void refresh_hld_last_timestamp(void); #else static inline void watchdog_update_hrtimer_threshold(u64 period) { } #endif diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index 0f105c06d8310835072c1a2ece6e17fa4bb5cd09..6eafba4223dd39b44983983728c1addcb61b776a 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -87,6 +87,15 @@ static bool watchdog_check_timestamp(void) __this_cpu_write(last_timestamp, now); return true; } + +void refresh_hld_last_timestamp(void) +{ + ktime_t now; + + now = ktime_get_mono_fast_ns(); + __this_cpu_write(last_timestamp, now); + +} #else static inline bool watchdog_check_timestamp(void) {