diff options
author | David Woodhouse <dwmw2@infradead.org> | 2005-11-16 19:44:03 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-17 00:53:38 -0500 |
commit | 1e28a7ddd3e713384e9c6768e7c502031dc205e2 (patch) | |
tree | 7600b576b660a531b27a72bd2e9ff67031c4dadb | |
parent | 5cfccd7f132432dd4705444a44b51d12ef88a85f (diff) |
[PATCH] Avoid use of uninitialised spinlock in EEH.
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>
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh.c | 3 | ||||
-rw-r--r-- | include/asm-powerpc/eeh.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c index 79de2310e70b..c8d2a40dc5b4 100644 --- a/arch/powerpc/platforms/pseries/eeh.c +++ b/arch/powerpc/platforms/pseries/eeh.c | |||
@@ -86,7 +86,8 @@ static int ibm_read_slot_reset_state; | |||
86 | static int ibm_read_slot_reset_state2; | 86 | static int ibm_read_slot_reset_state2; |
87 | static int ibm_slot_error_detail; | 87 | static int ibm_slot_error_detail; |
88 | 88 | ||
89 | static int eeh_subsystem_enabled; | 89 | int eeh_subsystem_enabled; |
90 | EXPORT_SYMBOL(eeh_subsystem_enabled); | ||
90 | 91 | ||
91 | /* Lock to avoid races due to multiple reports of an error */ | 92 | /* Lock to avoid races due to multiple reports of an error */ |
92 | static DEFINE_SPINLOCK(confirm_error_lock); | 93 | static DEFINE_SPINLOCK(confirm_error_lock); |
diff --git a/include/asm-powerpc/eeh.h b/include/asm-powerpc/eeh.h index 89f26ab31908..f8633aafe4ba 100644 --- a/include/asm-powerpc/eeh.h +++ b/include/asm-powerpc/eeh.h | |||
@@ -30,6 +30,8 @@ struct device_node; | |||
30 | 30 | ||
31 | #ifdef CONFIG_EEH | 31 | #ifdef CONFIG_EEH |
32 | 32 | ||
33 | extern int eeh_subsystem_enabled; | ||
34 | |||
33 | /* Values for eeh_mode bits in device_node */ | 35 | /* Values for eeh_mode bits in device_node */ |
34 | #define EEH_MODE_SUPPORTED (1<<0) | 36 | #define EEH_MODE_SUPPORTED (1<<0) |
35 | #define EEH_MODE_NOCHECK (1<<1) | 37 | #define EEH_MODE_NOCHECK (1<<1) |
@@ -75,7 +77,7 @@ void eeh_remove_device(struct pci_dev *); | |||
75 | * If this macro yields TRUE, the caller relays to eeh_check_failure() | 77 | * If this macro yields TRUE, the caller relays to eeh_check_failure() |
76 | * which does further tests out of line. | 78 | * which does further tests out of line. |
77 | */ | 79 | */ |
78 | #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0) | 80 | #define EEH_POSSIBLE_ERROR(val, type) ((val) == (type)~0 && eeh_subsystem_enabled) |
79 | 81 | ||
80 | /* | 82 | /* |
81 | * Reads from a device which has been isolated by EEH will return | 83 | * Reads from a device which has been isolated by EEH will return |