Skip to content

Commit

Permalink
watchdog: handle comma separated nmi_watchdog command line
Browse files Browse the repository at this point in the history
Per the document, the kernel can accept comma separated command line like
nmi_watchdog=nopanic,0.  However, the code doesn't really handle it.  Fix
the kernel to handle it properly.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Song Liu <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
liu-song-6 authored and akpm00 committed May 8, 2024
1 parent 91d743a commit 602ba77
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void __init hardlockup_detector_disable(void)

static int __init hardlockup_panic_setup(char *str)
{
next:
if (!strncmp(str, "panic", 5))
hardlockup_panic = 1;
else if (!strncmp(str, "nopanic", 7))
Expand All @@ -79,6 +80,12 @@ static int __init hardlockup_panic_setup(char *str)
watchdog_hardlockup_user_enabled = 0;
else if (!strncmp(str, "1", 1))
watchdog_hardlockup_user_enabled = 1;
while (*(str++)) {
if (*str == ',') {
str++;
goto next;
}
}
return 1;
}
__setup("nmi_watchdog=", hardlockup_panic_setup);
Expand Down

0 comments on commit 602ba77

Please sign in to comment.