* [PATCH] selftests/watchdog-test: Fix system accidentally reset after watchdog-test
@ 2024-10-29 3:13 Li Zhijian
2024-10-29 3:39 ` Shuah Khan
0 siblings, 1 reply; 2+ messages in thread
From: Li Zhijian @ 2024-10-29 3:13 UTC (permalink / raw)
To: shuah, linux-kselftest; +Cc: linux-kernel, Li Zhijian
When running watchdog-test with 'make run_tests', the watchdog-test will
be terminated by a timeout signal(SIGTERM) due to the test timemout.
And then, a system reboot would happen due to watchdog not stop. see
the dmesg as below:
```
[ 1367.185172] watchdog: watchdog0: watchdog did not stop!
```
Fix it by registering more signals(including SIGTERM) in watchdog-test,
where its signal handler will stop the watchdog.
After that
# timeout 1 ./watchdog-test
Watchdog Ticking Away!
.
Stopping watchdog ticks...
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
tools/testing/selftests/watchdog/watchdog-test.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
index bc71cbca0dde..a1f506ba5578 100644
--- a/tools/testing/selftests/watchdog/watchdog-test.c
+++ b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -334,7 +334,13 @@ int main(int argc, char *argv[])
printf("Watchdog Ticking Away!\n");
+ /*
+ * Register the signals
+ */
signal(SIGINT, term);
+ signal(SIGTERM, term);
+ signal(SIGKILL, term);
+ signal(SIGQUIT, term);
while (1) {
keep_alive();
--
2.44.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests/watchdog-test: Fix system accidentally reset after watchdog-test
2024-10-29 3:13 [PATCH] selftests/watchdog-test: Fix system accidentally reset after watchdog-test Li Zhijian
@ 2024-10-29 3:39 ` Shuah Khan
0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2024-10-29 3:39 UTC (permalink / raw)
To: Li Zhijian, shuah, linux-kselftest; +Cc: linux-kernel, Shuah Khan
On 10/28/24 21:13, Li Zhijian wrote:
> When running watchdog-test with 'make run_tests', the watchdog-test will
> be terminated by a timeout signal(SIGTERM) due to the test timemout.
>
> And then, a system reboot would happen due to watchdog not stop. see
> the dmesg as below:
> ```
> [ 1367.185172] watchdog: watchdog0: watchdog did not stop!
> ```
>
> Fix it by registering more signals(including SIGTERM) in watchdog-test,
> where its signal handler will stop the watchdog.
>
> After that
> # timeout 1 ./watchdog-test
> Watchdog Ticking Away!
> .
> Stopping watchdog ticks...
>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
> tools/testing/selftests/watchdog/watchdog-test.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
> index bc71cbca0dde..a1f506ba5578 100644
> --- a/tools/testing/selftests/watchdog/watchdog-test.c
> +++ b/tools/testing/selftests/watchdog/watchdog-test.c
> @@ -334,7 +334,13 @@ int main(int argc, char *argv[])
>
> printf("Watchdog Ticking Away!\n");
>
> + /*
> + * Register the signals
> + */
> signal(SIGINT, term);
> + signal(SIGTERM, term);
> + signal(SIGKILL, term);
> + signal(SIGQUIT, term);
>
> while (1) {
> keep_alive();
Thank you applied to kselftest fixes for next rc.
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-29 3:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 3:13 [PATCH] selftests/watchdog-test: Fix system accidentally reset after watchdog-test Li Zhijian
2024-10-29 3:39 ` Shuah Khan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox