Unverified Commit e283c4e1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14196 watchdog/perf: properly initialize the turbo mode timestamp and rearm counter

parents 7b1712f0 489196f3
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -290,11 +290,15 @@ void refresh_hld_last_timestamp(void)
	__this_cpu_write(last_timestamp, now);

}
#else
static inline bool watchdog_check_timestamp(void)

static void watchdog_init_timestamp(void)
{
	return true;
	__this_cpu_write(nmi_rearmed, 0);
	__this_cpu_write(last_timestamp, ktime_get_mono_fast_ns());
}
#else
static inline bool watchdog_check_timestamp(void) { return true; }
static inline void watchdog_init_timestamp(void) { }
#endif

void watchdog_hardlockup_check(struct pt_regs *regs)
@@ -416,6 +420,7 @@ void hardlockup_detector_perf_enable(void)
	if (!atomic_fetch_inc(&watchdog_cpus))
		pr_info("Enabled. Permanently consumes one hw-PMU counter.\n");

	watchdog_init_timestamp();
	perf_event_enable(this_cpu_read(watchdog_ev));
}