From: Wei Li liwei391@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4JUZZ
---------------------------
On ARM64, armv8_pmu_driver_init() is called in do_basic_setup(), it will fail to create perf event if lockup_detector_init() is moved back. So revert the patch firstly.
Fixes: 60565144df0a ("init: only move down lockup_detector_init() when sdei_watchdog is enabled") Signed-off-by: Wei Li liwei391@huawei.com Reviewed-by: Xiongfeng Wang wangxiongfeng2@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/arm64/kernel/watchdog_sdei.c | 2 +- include/linux/nmi.h | 2 -- init/main.c | 6 +----- 3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/arm64/kernel/watchdog_sdei.c b/arch/arm64/kernel/watchdog_sdei.c index cdbe2ebe3d69..aa980b090598 100644 --- a/arch/arm64/kernel/watchdog_sdei.c +++ b/arch/arm64/kernel/watchdog_sdei.c @@ -21,7 +21,7 @@ #define SDEI_NMI_WATCHDOG_HWIRQ 29
static int sdei_watchdog_event_num; -bool disable_sdei_nmi_watchdog; +static bool disable_sdei_nmi_watchdog; static bool sdei_watchdog_registered; static DEFINE_PER_CPU(ktime_t, last_check_time);
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 0cc36b799df6..a01ab0ade22d 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -241,10 +241,8 @@ int proc_watchdog_cpumask(struct ctl_table *, int, void *, size_t *, loff_t *);
#ifdef CONFIG_SDEI_WATCHDOG void sdei_watchdog_clear_eoi(void); -extern bool disable_sdei_nmi_watchdog; #else static inline void sdei_watchdog_clear_eoi(void) { } -#define disable_sdei_nmi_watchdog 1 #endif
#endif diff --git a/init/main.c b/init/main.c index 646e20a8d1ff..dedd20bcfc9c 100644 --- a/init/main.c +++ b/init/main.c @@ -1517,8 +1517,6 @@ static noinline void __init kernel_init_freeable(void)
rcu_init_tasks_generic(); do_pre_smp_initcalls(); - if (disable_sdei_nmi_watchdog) - lockup_detector_init();
smp_init(); sched_init_smp(); @@ -1530,9 +1528,7 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();
- /* sdei_watchdog needs to be initialized after sdei_init */ - if (!disable_sdei_nmi_watchdog) - lockup_detector_init(); + lockup_detector_init();
kunit_run_all_tests();