Skip to content

Panic on softdog timeout

Anithra P Janakiraman lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest0 patches 4 repliesIn review

Patches in v1 No applies recorded yet

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/0] Panic on softdog timeout

Hi.

We currently have no way of determining the reason for failure when a softdog timeout occurs. At the minimum a snapshot of the system would help to determine the cause. The attached patch invokes panic on softdog timeout iff kdump is configured, if kdump is not configured it works as usual.

---
 drivers/watchdog/softdog.c |   14 ++++++++++----
 kernel/kexec.c             |    1 +
 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/watchdog/softdog.c +10 -4
Index: linux-2.6.37-rc4/drivers/watchdog/softdog.c
===================================================================
@@ -48,6 +48,7 @@
 #include <linux/init.h>
 #include <linux/jiffies.h>
 #include <linux/uaccess.h>
+#include <linux/kexec.h>
 
 #define PFX "SoftDog: "
 
@@ -99,10 +100,15 @@
 	if (soft_noboot)
 		printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n");
 	else {
-		printk(KERN_CRIT PFX "Initiating system reboot.\n");
-		emergency_restart();
-		printk(KERN_CRIT PFX "Reboot didn't ?????\n");
-	}
+		if (kexec_crash_image) {
+			printk(KERN_CRIT PFX "Initiating kdump. \n");
+			panic("Watchdog timer expired.");
+		} else {
+			printk(KERN_CRIT PFX "Initiating system reboot. \n");
+			emergency_restart();
+			printk(KERN_CRIT PFX "Reboot didn't ?????\n");
+		}
+	      }
 }
 
 /*
kernel/kexec.c +1 -0
Index: linux-2.6.37-rc4/kernel/kexec.c
===================================================================
@@ -935,6 +935,7 @@
  */
 struct kimage *kexec_image;
 struct kimage *kexec_crash_image;
+EXPORT_SYMBOL(kexec_crash_image);
 
 static DEFINE_MUTEX(kexec_mutex);