From 2375ff3d09cd65b9000b0090f0eb89a14c684812 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Fri, 9 Sep 2022 03:30:53 +0000 Subject: [PATCH] watchdog/hardlockup: add hardlock_notifier_list Signed-off-by: Huibin Hong Change-Id: Id469d3c5a38f0bcb43a13a5c2263b53cf327154b --- kernel/watchdog.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 6cefee3c7e4c..c9b759ec1eb6 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -50,6 +50,9 @@ struct cpumask watchdog_cpumask __read_mostly; unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask); #ifdef CONFIG_HARDLOCKUP_DETECTOR + +ATOMIC_NOTIFIER_HEAD(hardlock_notifier_list); + /* * Should we panic when a soft-lockup or hard-lockup occurs: */ @@ -423,6 +426,8 @@ static void watchdog_check_hardlockup_other_cpu(void) if (per_cpu(hard_watchdog_warn, next_cpu) == true) return; + atomic_notifier_call_chain(&hardlock_notifier_list, 0, NULL); + if (hardlockup_panic) panic("Watchdog detected hard LOCKUP on cpu %u", next_cpu); else