From 820880f327cc7b168368800f6d0c4f60a731053a Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 18 Jan 2004 18:22:17 -0800 Subject: [PATCH] [PATCH] ppc64: Update the surveillance boot parameter to allow all valid settings of the surveillance timeout, from Nathan Fontenot From: Anton Blanchard 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 --git a/arch/ppc64/kernel/rtasd.c b/arch/ppc64/kernel/rtasd.c index eae216ef45895..36bb742ec4d6c 100644 --- a/arch/ppc64/kernel/rtasd.c +++ b/arch/ppc64/kernel/rtasd.c @@ -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_operations = { .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(char *str) int i; if (get_option(&str,&i)) { - if (i == 1) - surveillance_requested = 1; + if (i >= 0 && i <= 255) + surveillance_timeout = i; } return 1; diff --git a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h index f9336078be588..7adc4ad7934a5 100644 --- a/include/asm-ppc64/rtas.h +++ b/include/asm-ppc64/rtas.h @@ -205,8 +205,6 @@ extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); /* 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) -- 2.53.0