From 6ca3f484bde7b47226c7cba77232e8e118c989d3 Mon Sep 17 00:00:00 2001
From: Daniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Date: Wed, 25 Jun 2008 19:20:01 +0000
Subject: [PATCH] Make hangcheck reboot by default, and build it in to the
 kernel.

---
 kernel-2.6.spec                      |  2 ++
 linux-2.6-650-hangcheck-reboot.patch | 12 ++++++++++++
 planetlab-2.6.22-i586.config         |  2 +-
 planetlab-2.6.22-i686.config         |  2 +-
 planetlab-2.6.22-x86_64.config       |  2 +-
 5 files changed, 17 insertions(+), 3 deletions(-)
 create mode 100644 linux-2.6-650-hangcheck-reboot.patch

diff --git a/kernel-2.6.spec b/kernel-2.6.spec
index 0713c93b5..65b8d064c 100644
--- a/kernel-2.6.spec
+++ b/kernel-2.6.spec
@@ -173,6 +173,7 @@ Patch590: linux-2.6-590-chopstix-intern.patch
 Patch620: linux-2.6-620-kdb.patch
 Patch630: linux-2.6-630-sched-fix.patch
 Patch640: linux-2.6-640-netlink-audit-hack.patch
+Patch650: linux-2.6-650-hangcheck-reboot.patch
 
 # See also the file named 'sources' here for the related checksums
 # NOTE. iwlwifi should be in-kernel starting from 2.6.24
@@ -367,6 +368,7 @@ KERNEL_PREVIOUS=vanilla
 %ApplyPatch 620
 %ApplyPatch 630
 %ApplyPatch 640
+%ApplyPatch 650
 
 # NetNS conflict-resolving patch for VINI. Will work with patch vini_pl_patch-1 but may
 # break with later patches.
diff --git a/linux-2.6-650-hangcheck-reboot.patch b/linux-2.6-650-hangcheck-reboot.patch
new file mode 100644
index 000000000..398465d11
--- /dev/null
+++ b/linux-2.6-650-hangcheck-reboot.patch
@@ -0,0 +1,12 @@
+diff -Nurp linux-2.6.22-640/drivers/char/hangcheck-timer.c linux-2.6.22-650/drivers/char/hangcheck-timer.c
+--- linux-2.6.22-640/drivers/char/hangcheck-timer.c	2007-07-08 19:32:17.000000000 -0400
++++ linux-2.6.22-650/drivers/char/hangcheck-timer.c	2008-06-25 14:44:10.000000000 -0400
+@@ -57,7 +57,7 @@
+ 
+ static int hangcheck_tick = DEFAULT_IOFENCE_TICK;
+ static int hangcheck_margin = DEFAULT_IOFENCE_MARGIN;
+-static int hangcheck_reboot;  /* Defaults to not reboot */
++static int hangcheck_reboot = 1;  /* Defaults to reboot */
+ static int hangcheck_dump_tasks;  /* Defaults to not dumping SysRQ T */
+ 
+ /* options - modular */
diff --git a/planetlab-2.6.22-i586.config b/planetlab-2.6.22-i586.config
index 09e4254dd..d51d91050 100644
--- a/planetlab-2.6.22-i586.config
+++ b/planetlab-2.6.22-i586.config
@@ -1462,7 +1462,7 @@ CONFIG_NSC_GPIO=m
 CONFIG_CS5535_GPIO=m
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_HPET is not set
-CONFIG_HANGCHECK_TIMER=m
+CONFIG_HANGCHECK_TIMER=y
 
 #
 # TPM devices
diff --git a/planetlab-2.6.22-i686.config b/planetlab-2.6.22-i686.config
index d1236c576..e348069ea 100644
--- a/planetlab-2.6.22-i686.config
+++ b/planetlab-2.6.22-i686.config
@@ -1468,7 +1468,7 @@ CONFIG_NSC_GPIO=m
 CONFIG_CS5535_GPIO=m
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_HPET is not set
-CONFIG_HANGCHECK_TIMER=m
+CONFIG_HANGCHECK_TIMER=y
 
 #
 # TPM devices
diff --git a/planetlab-2.6.22-x86_64.config b/planetlab-2.6.22-x86_64.config
index d7324dc1a..c71da4b6a 100644
--- a/planetlab-2.6.22-x86_64.config
+++ b/planetlab-2.6.22-x86_64.config
@@ -1313,7 +1313,7 @@ CONFIG_PC8736x_GPIO=m
 CONFIG_NSC_GPIO=m
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_HPET is not set
-CONFIG_HANGCHECK_TIMER=m
+CONFIG_HANGCHECK_TIMER=y
 
 #
 # TPM devices
-- 
2.47.0