[PATCH] Avoid use of uninitialised spinlock in EEH.

David Woodhouse dwmw2 at infradead.org
Thu Sep 22 03:14:59 EST 2005


If the kernel supports both G5 and pSeries, and CONFIG_EEH is enabled,
eeh_init() is (quite reasonably) never called when we boot on a G5. Yet
eeh_check_failure() still gets called. We should avoid doing that if 
!eeh_subsystem_enabled.

Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

--- linux-2.6.13/include/asm-ppc64/eeh.h~	2005-09-21 16:36:23.000000000 +0100
+++ linux-2.6.13/include/asm-ppc64/eeh.h	2005-09-21 17:41:51.000000000 +0100
@@ -32,6 +32,8 @@ struct notifier_block;
 
 #ifdef CONFIG_EEH
 
+extern int eeh_subsystem_enabled;
+
 /* Values for eeh_mode bits in device_node */
 #define EEH_MODE_SUPPORTED	(1<<0)
 #define EEH_MODE_NOCHECK	(1<<1)
@@ -95,7 +97,7 @@ int eeh_unregister_notifier(struct notif
  * If this macro yields TRUE, the caller relays to eeh_check_failure()
  * which does further tests out of line.
  */
-#define EEH_POSSIBLE_ERROR(val, type)	((val) == (type)~0)
+#define EEH_POSSIBLE_ERROR(val, type)	(eeh_subsystem_enabled && (val) == (type)~0)
 
 /*
  * Reads from a device which has been isolated by EEH will return
--- linux-2.6.13/arch/ppc64/kernel/eeh.c~	2005-09-21 16:35:49.000000000 +0100
+++ linux-2.6.13/arch/ppc64/kernel/eeh.c	2005-09-21 17:40:41.000000000 +0100
@@ -99,7 +99,8 @@ static int ibm_read_slot_reset_state;
 static int ibm_read_slot_reset_state2;
 static int ibm_slot_error_detail;
 
-static int eeh_subsystem_enabled;
+int eeh_subsystem_enabled;
+EXPORT_SYMBOL(eeh_subsystem_enabled);
 
 /* Buffer for reporting slot-error-detail rtas calls */
 static unsigned char slot_errbuf[RTAS_ERROR_LOG_MAX];


-- 
dwmw2




More information about the Linuxppc64-dev mailing list