watchdog: Improve initialisation error message and documentation [Linux 2.6.37]

This Linux kernel change "watchdog: Improve initialisation error message and documentation" is included in the Linux 2.6.37 release. This change is authored by Ben Hutchings <ben [at]> on Sun Jan 2 23:02:42 2011 +0000. The commit for this change in Linux stable tree is 5514237 (patch).

watchdog: Improve initialisation error message and documentation

The error message 'NMI watchdog failed to create perf event...'
does not make it clear that this is a fatal error for the
watchdog.  It also currently prints the error value as a
pointer, rather than extracting the error code with PTR_ERR().
Fix that.

Add a note to the description of the 'nowatchdog' kernel
parameter to associate it with this message.

Reported-by: Cesare Leonardi <[email protected]>
Signed-off-by: Ben Hutchings <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Don Zickus <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: <[email protected]> # .37.x and later
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>

There are 5 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 Documentation/kernel-parameters.txt | 2 +-
 kernel/watchdog.c                   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 8b61c93..01ece1b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1759,7 +1759,7 @@ and is between 256 and 4096 characters. It is defined in the file

    nousb       [USB] Disable the USB subsystem

-   nowatchdog  [KNL] Disable the lockup detector.
+   nowatchdog  [KNL] Disable the lockup detector (NMI watchdog).

    nowb        [ARM]

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 6e3c41a..5b08215 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -364,7 +364,8 @@ static int watchdog_nmi_enable(int cpu)
        goto out_save;

-   printk(KERN_ERR "NMI watchdog failed to create perf event on cpu%i: %pn", cpu, event);
+   printk(KERN_ERR "NMI watchdog disabled for cpu%i: unable to create perf event: %ldn",
+          cpu, PTR_ERR(event));
    return PTR_ERR(event);

    /* success path */

Leave a Reply

Your email address will not be published. Required fields are marked *