aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/misc/ocxl/context.c
diff options
context:
space:
mode:
authorAlastair D'Silva <alastair@d-silva.org>2018-05-11 16:13:01 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-06-03 20:40:32 +1000
commite948e06fc63a1c1e36ec4c8e5c510b881ff19c26 (patch)
tree59a49968a3211c2708b135d6c79f97af3c9b2cb1 /drivers/misc/ocxl/context.c
parentocxl: Rename pnv_ocxl_spa_remove_pe to clarify it's action (diff)
downloadwireguard-linux-e948e06fc63a1c1e36ec4c8e5c510b881ff19c26.tar.xz
wireguard-linux-e948e06fc63a1c1e36ec4c8e5c510b881ff19c26.zip
ocxl: Expose the thread_id needed for wait on POWER9
In order to successfully issue as_notify, an AFU needs to know the TID to notify, which in turn means that this information should be available in userspace so it can be communicated to the AFU. Signed-off-by: Alastair D'Silva <alastair@d-silva.org> Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/ocxl/context.c')
-rw-r--r--drivers/misc/ocxl/context.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/ocxl/context.c b/drivers/misc/ocxl/context.c
index 909e8807824a..95f74623113e 100644
--- a/drivers/misc/ocxl/context.c
+++ b/drivers/misc/ocxl/context.c
@@ -34,6 +34,8 @@ int ocxl_context_init(struct ocxl_context *ctx, struct ocxl_afu *afu,
mutex_init(&ctx->xsl_error_lock);
mutex_init(&ctx->irq_lock);
idr_init(&ctx->irq_idr);
+ ctx->tidr = 0;
+
/*
* Keep a reference on the AFU to make sure it's valid for the
* duration of the life of the context
@@ -65,6 +67,7 @@ int ocxl_context_attach(struct ocxl_context *ctx, u64 amr)
{
int rc;
+ // Locks both status & tidr
mutex_lock(&ctx->status_mutex);
if (ctx->status != OPENED) {
rc = -EIO;
@@ -72,7 +75,7 @@ int ocxl_context_attach(struct ocxl_context *ctx, u64 amr)
}
rc = ocxl_link_add_pe(ctx->afu->fn->link, ctx->pasid,
- current->mm->context.id, 0, amr, current->mm,
+ current->mm->context.id, ctx->tidr, amr, current->mm,
xsl_fault_error, ctx);
if (rc)
goto out;