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

[PATCH RFC 12/15] powerpc/eeh: Sync eeh_pe_get_state()

From: Sam Bobroff <hidden>
Date: 2019-10-02 06:19:26
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 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 171be70b34d8..cba16ca0694a 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -1689,6 +1689,7 @@ int eeh_pe_get_state(struct eeh_pe *pe)
 {
 	int result, ret = 0;
 	bool rst_active, dma_en, mmio_en;
+	unsigned long flags;
 
 	/* Existing PE ? */
 	if (!pe)
@@ -1703,10 +1704,14 @@ int eeh_pe_get_state(struct eeh_pe *pe)
 	 * unavailable so that the error recovery on the guest is suspended
 	 * until the recovery completes on the host.
 	 */
+	eeh_lock_pes(&flags);
 	if (pe->parent &&
 	    !(pe->state & EEH_PE_REMOVED) &&
-	    (pe->parent->state & (EEH_PE_ISOLATED | EEH_PE_RECOVERING)))
+	    (pe->parent->state & (EEH_PE_ISOLATED | EEH_PE_RECOVERING))) {
+		eeh_unlock_pes(flags);
 		return EEH_PE_STATE_UNAVAIL;
+	}
+	eeh_unlock_pes(flags);
 
 	result = eeh_ops->get_state(pe, NULL);
 	rst_active = !!(result & EEH_STATE_RESET_ACTIVE);
-- 
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