Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: sbsa: Test WDOG_HW_RUNNING bit in suspend and resume

If the sbsa_gwdt is enabled by BIOS, the kernel set WDOG_HW_RUNNING bit
and keep it alive before anyone else would open it. When system suspend,
the sbsa_gwdt would not be disabled because WDOG_ACTIVE is not set. Then
the sbsa_gwdt would reach timeout since no one touch it during system
suspend.

To solve this, just test WDOG_HW_RUNNING bit in suspend and disable the
sbsa_gwdt if the bit is set, then reopen it accordingly in resume
process.

Signed-off-by: Wang Wensheng <wangwensheng4@huawei.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230301113702.76437-1-wangwensheng4@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Wang Wensheng and committed by
Wim Van Sebroeck
74d6c68c 96c6e56d

+2 -2
+2 -2
drivers/watchdog/sbsa_gwdt.c
··· 361 361 { 362 362 struct sbsa_gwdt *gwdt = dev_get_drvdata(dev); 363 363 364 - if (watchdog_active(&gwdt->wdd)) 364 + if (watchdog_hw_running(&gwdt->wdd)) 365 365 sbsa_gwdt_stop(&gwdt->wdd); 366 366 367 367 return 0; ··· 372 372 { 373 373 struct sbsa_gwdt *gwdt = dev_get_drvdata(dev); 374 374 375 - if (watchdog_active(&gwdt->wdd)) 375 + if (watchdog_hw_running(&gwdt->wdd)) 376 376 sbsa_gwdt_start(&gwdt->wdd); 377 377 378 378 return 0;