提交 1e28a7dd 编写于 作者: D David Woodhouse 提交者: Paul Mackerras

[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: NDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 5cfccd7f
...@@ -86,7 +86,8 @@ static int ibm_read_slot_reset_state; ...@@ -86,7 +86,8 @@ static int ibm_read_slot_reset_state;
static int ibm_read_slot_reset_state2; static int ibm_read_slot_reset_state2;
static int ibm_slot_error_detail; 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 */ /* Lock to avoid races due to multiple reports of an error */
static DEFINE_SPINLOCK(confirm_error_lock); static DEFINE_SPINLOCK(confirm_error_lock);
......
...@@ -30,6 +30,8 @@ struct device_node; ...@@ -30,6 +30,8 @@ struct device_node;
#ifdef CONFIG_EEH #ifdef CONFIG_EEH
extern int eeh_subsystem_enabled;
/* Values for eeh_mode bits in device_node */ /* Values for eeh_mode bits in device_node */
#define EEH_MODE_SUPPORTED (1<<0) #define EEH_MODE_SUPPORTED (1<<0)
#define EEH_MODE_NOCHECK (1<<1) #define EEH_MODE_NOCHECK (1<<1)
...@@ -75,7 +77,7 @@ void eeh_remove_device(struct pci_dev *); ...@@ -75,7 +77,7 @@ void eeh_remove_device(struct pci_dev *);
* If this macro yields TRUE, the caller relays to eeh_check_failure() * If this macro yields TRUE, the caller relays to eeh_check_failure()
* which does further tests out of line. * 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 * Reads from a device which has been isolated by EEH will return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册