Commit 820880f3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: Update the surveillance boot parameter to allow all valid...

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

From: Anton Blanchard <anton@samba.org>

Update the surveillance boot parameter to allow all valid settings of the
surveillance timeout, from Nathan Fontenot
parent e528ff69
......@@ -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 @@ static int rtasd(void *unused)
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;
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment