aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2013-06-20 01:21:03 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-06-20 03:06:11 -0400
commit4907581dc21f43f94d3a15dd98f62a8f936b3050 (patch)
tree4e8eb5043733c851d2b9bf08227d56933eca5f8a /arch/powerpc/kernel
parent99866595340fa24079f61962b2541db3225e7aad (diff)
powerpc/eeh: Export confirm_error_lock
An EEH event is created and queued to the event queue for each ingress EEH error. When there're mutiple EEH errors, we need serialize the process to keep consistent PE state (flags). The spinlock "confirm_error_lock" was introduced for the purpose. We'll inject EEH event upon error reporting interrupts on PowerNV platform. So we export the spinlock for that to use for consistent PE state. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/eeh.c10
1 files changed, 4 insertions, 6 deletions
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)