[PATCH] Avoid use of uninitialised spinlock in EEH.

linas linas at austin.ibm.com
Sat Nov 19 09:14:56 EST 2005


Hi Paul,

This looks like an entirely reasonable patch to me. Please push 
if you agree.

--linas

On Thu, Nov 17, 2005 at 12:44:03AM +0000, David Woodhouse was heard to remark:
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>
Acked-by: Linas Vepstas <linas at austin.ibm.com>

--- linux-2.6.13/include/asm-powerpc/eeh.h~	2005-09-21 16:36:23.000000000 +0100
+++ linux-2.6.13/include/asm-powerpc/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)	((val) == (type)~0 && eeh_subsystem_enabled)
 
 /*
  * Reads from a device which has been isolated by EEH will return
--- linux-2.6.13/arch/powerpc/platforms/pseries/eeh.c~	2005-09-21 16:35:49.000000000 +0100
+++ linux-2.6.13/arch/powerpc/platforms/pseries/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