[PATCH] Fix rtasd zombie on PowerMac G5

The rtasd kernel thread would exit before daemoniz'ing itself if
RTAS wasn't present (or if allocation of the buffer failed), thus
leaving a zombie. This patch fixes it (and remove #if 0'ed code)
parent d9bb5003
...@@ -347,6 +347,8 @@ static int rtasd(void *unused) ...@@ -347,6 +347,8 @@ static int rtasd(void *unused)
int event_scan = rtas_token("event-scan"); int event_scan = rtas_token("event-scan");
int rc; int rc;
daemonize("rtasd");
if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1) if (event_scan == RTAS_UNKNOWN_SERVICE || get_eventscan_parms() == -1)
goto error; goto error;
...@@ -359,15 +361,9 @@ static int rtasd(void *unused) ...@@ -359,15 +361,9 @@ static int rtasd(void *unused)
/* We can use rtas_log_buf now */ /* We can use rtas_log_buf now */
no_more_logging = 0; no_more_logging = 0;
DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2); printk(KERN_ERR "RTAS daemon started\n");
daemonize("rtasd");
#if 0 DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2);
/* Rusty unreal time task */
current->policy = SCHED_FIFO;
current->nice = sys_sched_get_priority_max(SCHED_FIFO) + 1;
#endif
/* See if we have any error stored in NVRAM */ /* See if we have any error stored in NVRAM */
memset(logdata, 0, rtas_error_log_max); memset(logdata, 0, rtas_error_log_max);
...@@ -423,7 +419,9 @@ static int rtasd(void *unused) ...@@ -423,7 +419,9 @@ static int rtasd(void *unused)
goto repeat; goto repeat;
error_vfree: error_vfree:
vfree(rtas_log_buf); 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;
...@@ -451,8 +449,6 @@ static int __init rtas_init(void) ...@@ -451,8 +449,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");
printk(KERN_ERR "RTAS daemon started\n");
/* Make room for the sequence number */ /* Make room for the sequence number */
rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int); rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
......
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