[PATCH] Avoid use of uninitialised spinlock in EEH.
authorDavid Woodhouse <dwmw2@infradead.org>
Thu, 17 Nov 2005 00:44:03 +0000 (00:44 +0000)
committerPaul Mackerras <paulus@samba.org>
Thu, 17 Nov 2005 05:53:38 +0000 (16:53 +1100)
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@infradead.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/pseries/eeh.c
include/asm-powerpc/eeh.h

index 79de2310e70b86eb050eae59e45e3a10dd933337..c8d2a40dc5b48ceb6038b3f9fcbc8bc036850efa 100644 (file)
@@ -86,7 +86,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);
 
 /* Lock to avoid races due to multiple reports of an error */
 static DEFINE_SPINLOCK(confirm_error_lock);
index 89f26ab31908df6e72932291568340243ba7b4b3..f8633aafe4baa5d000e608b35b92e5f13be45311 100644 (file)
@@ -30,6 +30,8 @@ struct device_node;
 
 #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)
@@ -75,7 +77,7 @@ void eeh_remove_device(struct pci_dev *);
  * 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