Thread (17 messages) flat view 17 messages, 2 authors, 2019-11-13
STALE2483d

[PATCH RFC 10/15] powerpc/eeh: Sync eeh_phb_check_failure()

From: Sam Bobroff <hidden>
Date: 2019-10-02 06:09:21
Subsystem: linux for powerpc (32-bit and 64-bit), pci enhanced error handling (eeh) for powerpc, the rest · Maintainers: Madhavan Srinivasan, Mahesh J Salgaonkar, Linus Torvalds

Synchronize access to eeh_pe.

Signed-off-by: Sam Bobroff <redacted>
---
 arch/powerpc/kernel/eeh.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 7eb6ca1ab72b..eb37cb384ff4 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -394,7 +394,7 @@ static int eeh_phb_check_failure(struct eeh_pe *pe)
 		return -EPERM;
 
 	/* Find the PHB PE */
-	phb_pe = eeh_phb_pe_get(pe->phb);
+	phb_pe = eeh_phb_pe_get(pe->phb); /* Acquire ref */
 	if (!phb_pe) {
 		pr_warn("%s Can't find PE for PHB#%x\n",
 			__func__, pe->phb->global_number);
@@ -422,9 +422,10 @@ static int eeh_phb_check_failure(struct eeh_pe *pe)
 
 	pr_debug("EEH: PHB#%x failure detected, location: %s\n",
 		phb_pe->phb->global_number, eeh_pe_loc_get(phb_pe));
-	eeh_send_failure_event(phb_pe);
+	eeh_send_failure_event(phb_pe); /* Give ref */
 	return 1;
 out:
+	eeh_put_pe(phb_pe); /* Release ref */
 	eeh_serialize_unlock(flags);
 	return ret;
 }
-- 
2.22.0.216.g00a2a96fc9
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help