aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/eeh.h11
-rw-r--r--arch/powerpc/kernel/eeh.c10
2 files changed, 15 insertions, 6 deletions
diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
index e1109fd87ff4..0c0ac93f422f 100644
--- a/arch/powerpc/include/asm/eeh.h
+++ b/arch/powerpc/include/asm/eeh.h
@@ -150,6 +150,7 @@ struct eeh_ops {
150extern struct eeh_ops *eeh_ops; 150extern struct eeh_ops *eeh_ops;
151extern int eeh_subsystem_enabled; 151extern int eeh_subsystem_enabled;
152extern struct mutex eeh_mutex; 152extern struct mutex eeh_mutex;
153extern raw_spinlock_t confirm_error_lock;
153extern int eeh_probe_mode; 154extern int eeh_probe_mode;
154 155
155#define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */ 156#define EEH_PROBE_MODE_DEV (1<<0) /* From PCI device */
@@ -180,6 +181,16 @@ static inline void eeh_unlock(void)
180 mutex_unlock(&eeh_mutex); 181 mutex_unlock(&eeh_mutex);
181} 182}
182 183
184static inline void eeh_serialize_lock(unsigned long *flags)
185{
186 raw_spin_lock_irqsave(&confirm_error_lock, *flags);
187}
188
189static inline void eeh_serialize_unlock(unsigned long flags)
190{
191 raw_spin_unlock_irqrestore(&confirm_error_lock, flags);
192}
193
183/* 194/*
184 * Max number of EEH freezes allowed before we consider the device 195 * Max number of EEH freezes allowed before we consider the device
185 * to be permanently disabled. 196 * to be permanently disabled.
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 777ecc06af19..81cd0311dee8 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -107,7 +107,7 @@ int eeh_probe_mode;
107DEFINE_MUTEX(eeh_mutex); 107DEFINE_MUTEX(eeh_mutex);
108 108
109/* Lock to avoid races due to multiple reports of an error */ 109/* Lock to avoid races due to multiple reports of an error */
110static DEFINE_RAW_SPINLOCK(confirm_error_lock); 110DEFINE_RAW_SPINLOCK(confirm_error_lock);
111 111
112/* Buffer for reporting pci register dumps. Its here in BSS, and 112/* Buffer for reporting pci register dumps. Its here in BSS, and
113 * not dynamically alloced, so that it ends up in RMO where RTAS 113 * not dynamically alloced, so that it ends up in RMO where RTAS
@@ -325,7 +325,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
325 * in one slot might report errors simultaneously, and we 325 * in one slot might report errors simultaneously, and we
326 * only want one error recovery routine running. 326 * only want one error recovery routine running.
327 */ 327 */
328 raw_spin_lock_irqsave(&confirm_error_lock, flags); 328 eeh_serialize_lock(&flags);
329 rc = 1; 329 rc = 1;
330 if (pe->state & EEH_PE_ISOLATED) { 330 if (pe->state & EEH_PE_ISOLATED) {
331 pe->check_count++; 331 pe->check_count++;
@@ -374,7 +374,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
374 * bridges. 374 * bridges.
375 */ 375 */
376 eeh_pe_state_mark(pe, EEH_PE_ISOLATED); 376 eeh_pe_state_mark(pe, EEH_PE_ISOLATED);
377 raw_spin_unlock_irqrestore(&confirm_error_lock, flags); 377 eeh_serialize_unlock(flags);
378 378
379 eeh_send_failure_event(pe); 379 eeh_send_failure_event(pe);
380 380
@@ -386,7 +386,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
386 return 1; 386 return 1;
387 387
388dn_unlock: 388dn_unlock:
389 raw_spin_unlock_irqrestore(&confirm_error_lock, flags); 389 eeh_serialize_unlock(flags);
390 return rc; 390 return rc;
391} 391}
392 392
@@ -702,8 +702,6 @@ int __init eeh_init(void)
702 return ret; 702 return ret;
703 } 703 }
704 704
705 raw_spin_lock_init(&confirm_error_lock);
706
707 /* Initialize EEH event */ 705 /* Initialize EEH event */
708 ret = eeh_event_init(); 706 ret = eeh_event_init();
709 if (ret) 707 if (ret)