From 84a10585295ddd3987abed1992b06fa5fb08f93a Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Thu, 23 Nov 2017 15:29:28 +0800 Subject: [PATCH] watchdog: meson-wdt: fix reboot notify to stop reset PD#154679: watchdog: meson-wdt: fix reboot notify to stop reset In some cases, the watchdog reboot notify will not disable watchdog. The watchdog reset workqueue will continue work in the first cpu that invokes panic(oops). So the hardware watchdog will not reboot. Cancel the delayed workqueue to stop reset the watchdog in reboot notify. And move the print message to the right location. Change-Id: I7d85d49f2f5d780f7c5f2612e64494e77957dfff Signed-off-by: Bo Yang --- drivers/amlogic/watchdog/meson_wdt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/amlogic/watchdog/meson_wdt.c b/drivers/amlogic/watchdog/meson_wdt.c index b5206184eacc..121305d734e2 100644 --- a/drivers/amlogic/watchdog/meson_wdt.c +++ b/drivers/amlogic/watchdog/meson_wdt.c @@ -268,11 +268,13 @@ static int aml_wtd_reboot_notify(struct notifier_block *nb, { struct aml_wdt_dev *wdev; + wdev = container_of(nb, struct aml_wdt_dev, reboot_notifier); if (event == SYS_DOWN || event == SYS_HALT) { - wdev = container_of(nb, struct aml_wdt_dev, reboot_notifier); disable_watchdog(wdev); + pr_info("disable watchdog\n"); } - pr_info("disable watchdog\n"); + if (wdev->reset_watchdog_method == 1) + cancel_delayed_work(&wdev->boot_queue); return NOTIFY_OK; }