diff --git a/arch/arm64/kernel/watchdog_sdei.c b/arch/arm64/kernel/watchdog_sdei.c index a2154aa6f27ab9f1fe7242688398dd91252aedc6..e36c4d398893b8875224539ad60842488204625a 100644 --- a/arch/arm64/kernel/watchdog_sdei.c +++ b/arch/arm64/kernel/watchdog_sdei.c @@ -30,6 +30,8 @@ int watchdog_nmi_enable(unsigned int cpu) if (!sdei_watchdog_registered) return -EINVAL; + 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 a11a12d5e3e821de06410caa2bde2d7af10d923c..a7d817b5fa84b098dba7a93259f5ec6eca10d19a 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -206,6 +206,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 76ac86caa50f6579c5d649c33c19c24eb64532af..88f5c314a1dfc9082abcd48bfa233caca495c175 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -89,6 +89,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) {