[ppc64] Update the surveillance boot parameter to allow all valid settings of the surveillance timeout, from Nathan Fontenot


---

 arch/ppc64/kernel/rtasd.c |   16 +++++++---------
 include/asm-ppc64/rtas.h  |    2 --
 2 files changed, 7 insertions(+), 11 deletions(-)

diff -puN arch/ppc64/kernel/rtasd.c~ppc64-surveillance arch/ppc64/kernel/rtasd.c
--- 25/arch/ppc64/kernel/rtasd.c~ppc64-surveillance	2004-01-13 23:23:01.000000000 -0800
+++ 25-akpm/arch/ppc64/kernel/rtasd.c	2004-01-13 23:23:01.000000000 -0800
@@ -41,7 +41,7 @@ static char *rtas_log_buf;
 static unsigned long rtas_log_start;
 static unsigned long rtas_log_size;
 
-static int surveillance_requested;
+static int surveillance_timeout = -1;
 static unsigned int rtas_event_scan_rate;
 static unsigned int rtas_error_log_max;
 static unsigned int rtas_error_log_buffer_max;
@@ -287,20 +287,18 @@ struct file_operations proc_rtas_log_ope
 	.release =	rtas_log_release,
 };
 
-static int enable_surveillance(void)
+static int enable_surveillance(int timeout)
 {
 	int error;
 
 	error = rtas_call(rtas_token("set-indicator"), 3, 1, NULL,
-			  SURVEILLANCE_TOKEN, 0, SURVEILLANCE_TIMEOUT);
+			  SURVEILLANCE_TOKEN, 0, timeout);
 
 	if (error) {
 		printk(KERN_ERR "rtasd: could not enable surveillance\n");
 		return -1;
 	}
 
-	rtas_event_scan_rate = SURVEILLANCE_SCANRATE;
-
 	return 0;
 }
 
@@ -414,9 +412,9 @@ repeat:
 		schedule_timeout(first_pass ? HZ : (HZ*60/rtas_event_scan_rate) / 2);
 	}
 
-	if (first_pass && surveillance_requested) {
+	if (first_pass && (surveillance_timeout != -1)) {
 		DEBUG("enabling surveillance\n");
-		if (enable_surveillance())
+		if (enable_surveillance(surveillance_timeout))
 			goto error_vfree;
 		DEBUG("surveillance enabled\n");
 	}
@@ -466,8 +464,8 @@ static int __init surveillance_setup(cha
 	int i;
 
 	if (get_option(&str,&i)) {
-		if (i == 1)
-			surveillance_requested = 1;
+		if (i >= 0 && i <= 255)
+			surveillance_timeout = i;
 	}
 
 	return 1;
diff -puN include/asm-ppc64/rtas.h~ppc64-surveillance include/asm-ppc64/rtas.h
--- 25/include/asm-ppc64/rtas.h~ppc64-surveillance	2004-01-13 23:23:01.000000000 -0800
+++ 25-akpm/include/asm-ppc64/rtas.h	2004-01-13 23:23:01.000000000 -0800
@@ -205,8 +205,6 @@ extern void pSeries_log_error(char *buf,
 /* Event Scan Parameters */
 #define EVENT_SCAN_ALL_EVENTS	0xf0000000
 #define SURVEILLANCE_TOKEN	9000
-#define SURVEILLANCE_TIMEOUT	1
-#define SURVEILLANCE_SCANRATE	1
 #define LOG_NUMBER		64		/* must be a power of two */
 #define LOG_NUMBER_MASK		(LOG_NUMBER-1)
 

_