diff mbox

[4/7] CXL: Early return from cxl_handle_fault for a shut down context

Message ID 1418026681-14787-4-git-send-email-imunsie@au.ibm.com (mailing list archive)
State Accepted
Commit 13da704682471669685ccc3fe111fd6c0127b2eb
Delegated to: Michael Ellerman
Headers show

Commit Message

Ian Munsie Dec. 8, 2014, 8:17 a.m. UTC
From: Ian Munsie <imunsie@au1.ibm.com>

If a context is being detached and we get a translation fault for it
there is little point getting it's mm and handling the fault, so just
respond with an address error and return earlier.

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
---
 drivers/misc/cxl/fault.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
index c99e896..3e8c06a 100644
--- a/drivers/misc/cxl/fault.c
+++ b/drivers/misc/cxl/fault.c
@@ -176,6 +176,12 @@  void cxl_handle_fault(struct work_struct *fault_work)
 		return;
 	}
 
+	/* Early return if the context is being / has been detached */
+	if (ctx->status == CLOSED) {
+		cxl_ack_ae(ctx);
+		return;
+	}
+
 	pr_devel("CXL BOTTOM HALF handling fault for afu pe: %i. "
 		"DSISR: %#llx DAR: %#llx\n", ctx->pe, dsisr, dar);