提交 07789def 编写于 作者: X Xiongfeng Wang 提交者: Xie XiuQi

sdei_watchdog: do not disable sdei_watchdog event when failed to initialise SDEI

euler inclusion
category: feature
Bugzilla: 5515
CVE: N/A

----------------------------------------

When we modify '/proc/sys/kernel/watchdog_thresh', kernel will call
'watchdog_nmi_disable' before change 'watchdog_thresh'. If firmware does
not support SDEI, we will get 'SDEI NMI Watchdog: Disable NMI Watchdog
failed on cpuX'. It is because we failed to disable sdei_watchdog event.
It has no bad effect.

This patch add a flag to record whether we have registered sdei_watchdog
successfully and do not disable sdei_watchdog event if we failed to
register sdei_watchdog event.
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8607b627
......@@ -21,11 +21,15 @@
static int sdei_watchdog_event_num;
static bool disable_sdei_nmi_watchdog;
static bool sdei_watchdog_registered;
int watchdog_nmi_enable(unsigned int cpu)
{
int ret;
if (!sdei_watchdog_registered)
return -EINVAL;
refresh_hld_last_timestamp();
ret = sdei_api_event_enable(sdei_watchdog_event_num);
......@@ -42,6 +46,9 @@ void watchdog_nmi_disable(unsigned int cpu)
{
int ret;
if (!sdei_watchdog_registered)
return;
ret = sdei_api_event_disable(sdei_watchdog_event_num);
if (ret)
pr_err("Disable NMI Watchdog failed on cpu%d\n",
......@@ -87,7 +94,7 @@ int __init watchdog_nmi_probe(void)
sdei_watchdog_event_num = sdei_api_event_interrupt_bind(SDEI_NMI_WATCHDOG_HWIRQ);
if (sdei_watchdog_event_num < 0) {
pr_err("bind interrupt failed !\n");
pr_err("Bind interrupt failed. Firmware may not support SDEI !\n");
return sdei_watchdog_event_num;
}
......@@ -100,6 +107,7 @@ int __init watchdog_nmi_probe(void)
return ret;
}
sdei_watchdog_registered = true;
pr_info("SDEI Watchdog registered successfully\n");
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册