Patchwork rtasd: Don't start event scan if scan rate is zero

login
register
mail settings
Submitter Michael Ellerman
Date May 19, 2010, 12:12 p.m.
Message ID <a14b6e8101e0b1ef31b4096c4e9550e625d7558d.1274271144.git.michael@ellerman.id.au>
Download mbox | patch
Permalink /patch/52976/
State Accepted, archived
Commit 7358650e9e9a81c854dc4582b4193eb5ea500bf6
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

Michael Ellerman - May 19, 2010, 12:12 p.m.
There appear to be Pegasos systems which have the rtas-event-scan
RTAS tokens, but on which the event scan always fails. They also
have an event-scan-rate property containing 0, which means call
event scan 0 times per minute.

So interpret a scan rate of 0 to mean don't scan at all. This fixes
the problem on the Pegasos machines and makes sense as well.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/kernel/rtasd.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index e907ca6..638883e 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -490,6 +490,12 @@  static int __init rtas_init(void)
 		return -ENODEV;
 	}
 
+	if (!rtas_event_scan_rate) {
+		/* Broken firmware: take a rate of zero to mean don't scan */
+		printk(KERN_DEBUG "rtasd: scan rate is 0, not scanning\n");
+		return 0;
+	}
+
 	/* Make room for the sequence number */
 	rtas_error_log_max = rtas_get_error_log_max();
 	rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);