未验证 提交 01267006 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!81 Fix watchdog blocking reboot issue on ACPI WDAT watchdog enabled system

Merge Pull Request from: @yunyingsun 
 
This patchset is to fix watchdog blocking reboot issue on ACPI WDAT watchdog enabled system.

The 3 patches are identical with upstream and applied cleanly.

Intel-kernel issue:
https://gitee.com/openeuler/intel-kernel/issues/I5N2K6

Test:
Without this patchset, on ACPI WDAT watchdog enabled systems, system soft reboot will lead to system hang.
With this patchset, on ACPI WDAT watchdog enabled systems, system reboot works fine.

Known issue:
N/A

Default config change:
N/A 
 
Link:https://gitee.com/openeuler/kernel/pulls/81 
Reviewed-by: Jun Tian <jun.j.tian@intel.com> 
Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com> 
...@@ -344,6 +344,7 @@ static int wdat_wdt_probe(struct platform_device *pdev) ...@@ -344,6 +344,7 @@ static int wdat_wdt_probe(struct platform_device *pdev)
wdat->period = tbl->timer_period; wdat->period = tbl->timer_period;
wdat->wdd.min_hw_heartbeat_ms = wdat->period * tbl->min_count; wdat->wdd.min_hw_heartbeat_ms = wdat->period * tbl->min_count;
wdat->wdd.max_hw_heartbeat_ms = wdat->period * tbl->max_count; wdat->wdd.max_hw_heartbeat_ms = wdat->period * tbl->max_count;
wdat->wdd.min_timeout = 1;
wdat->stopped_in_sleep = tbl->flags & ACPI_WDAT_STOPPED; wdat->stopped_in_sleep = tbl->flags & ACPI_WDAT_STOPPED;
wdat->wdd.info = &wdat_wdt_info; wdat->wdd.info = &wdat_wdt_info;
wdat->wdd.ops = &wdat_wdt_ops; wdat->wdd.ops = &wdat_wdt_ops;
...@@ -450,8 +451,7 @@ static int wdat_wdt_probe(struct platform_device *pdev) ...@@ -450,8 +451,7 @@ static int wdat_wdt_probe(struct platform_device *pdev)
* watchdog properly after it has opened the device. In some cases * watchdog properly after it has opened the device. In some cases
* the BIOS default is too short and causes immediate reboot. * the BIOS default is too short and causes immediate reboot.
*/ */
if (timeout * 1000 < wdat->wdd.min_hw_heartbeat_ms || if (watchdog_timeout_invalid(&wdat->wdd, timeout)) {
timeout * 1000 > wdat->wdd.max_hw_heartbeat_ms) {
dev_warn(dev, "Invalid timeout %d given, using %d\n", dev_warn(dev, "Invalid timeout %d given, using %d\n",
timeout, WDAT_DEFAULT_TIMEOUT); timeout, WDAT_DEFAULT_TIMEOUT);
timeout = WDAT_DEFAULT_TIMEOUT; timeout = WDAT_DEFAULT_TIMEOUT;
...@@ -462,6 +462,8 @@ static int wdat_wdt_probe(struct platform_device *pdev) ...@@ -462,6 +462,8 @@ static int wdat_wdt_probe(struct platform_device *pdev)
return ret; return ret;
watchdog_set_nowayout(&wdat->wdd, nowayout); watchdog_set_nowayout(&wdat->wdd, nowayout);
watchdog_stop_on_reboot(&wdat->wdd);
watchdog_stop_on_unregister(&wdat->wdd);
return devm_watchdog_register_device(dev, &wdat->wdd); return devm_watchdog_register_device(dev, &wdat->wdd);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册