Commit d90fba56 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: Misc rtasd fixes

From: Jake Moilanen <moilanen@austin.ibm.com>

Misc rtasd fixes for some broken firmware versions.
parent 18e0d816
...@@ -119,10 +119,11 @@ static int log_rtas_len(char * buf) ...@@ -119,10 +119,11 @@ static int log_rtas_len(char * buf)
/* extended header */ /* extended header */
len += err->extended_log_length; len += err->extended_log_length;
if (len > RTAS_ERROR_LOG_MAX)
len = RTAS_ERROR_LOG_MAX;
} }
if (len > rtas_error_log_max)
len = rtas_error_log_max;
return len; return len;
} }
...@@ -330,6 +331,10 @@ static int get_eventscan_parms(void) ...@@ -330,6 +331,10 @@ static int get_eventscan_parms(void)
printk(KERN_ERR "rtasd: truncated error log from %d to %d bytes\n", rtas_error_log_max, RTAS_ERROR_LOG_MAX); printk(KERN_ERR "rtasd: truncated error log from %d to %d bytes\n", rtas_error_log_max, RTAS_ERROR_LOG_MAX);
rtas_error_log_max = RTAS_ERROR_LOG_MAX; rtas_error_log_max = RTAS_ERROR_LOG_MAX;
} }
/* Make room for the sequence number */
rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
of_node_put(node); of_node_put(node);
return 0; return 0;
...@@ -405,8 +410,7 @@ static int rtasd(void *unused) ...@@ -405,8 +410,7 @@ static int rtasd(void *unused)
if (surveillance_timeout != -1) { if (surveillance_timeout != -1) {
DEBUG("enabling surveillance\n"); DEBUG("enabling surveillance\n");
if (enable_surveillance(surveillance_timeout)) enable_surveillance(surveillance_timeout);
goto error_vfree;
DEBUG("surveillance enabled\n"); DEBUG("surveillance enabled\n");
} }
...@@ -430,10 +434,6 @@ static int rtasd(void *unused) ...@@ -430,10 +434,6 @@ static int rtasd(void *unused)
cpu = first_cpu_const(mk_cpumask_const(cpu_online_map)); cpu = first_cpu_const(mk_cpumask_const(cpu_online_map));
} }
error_vfree:
if (rtas_log_buf)
vfree(rtas_log_buf);
rtas_log_buf = NULL;
error: error:
/* Should delete proc entries */ /* Should delete proc entries */
return -EINVAL; return -EINVAL;
...@@ -459,9 +459,6 @@ static int __init rtas_init(void) ...@@ -459,9 +459,6 @@ static int __init rtas_init(void)
if (kernel_thread(rtasd, 0, CLONE_FS) < 0) if (kernel_thread(rtasd, 0, CLONE_FS) < 0)
printk(KERN_ERR "Failed to start RTAS daemon\n"); printk(KERN_ERR "Failed to start RTAS daemon\n");
/* Make room for the sequence number */
rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
return 0; return 0;
} }
......
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