This reworks contexts lifetimes a bit to enable the kernel API where we may
want to reuse contexts. Here we will want to start and stop contexts without
freeing them.
Start context does the get pid & ctx so stop context will need to do the puts.
Here we move put pid & ctx to the detach context path which will become part of
the stop context path.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
return -EBUSY;
WARN_ON(cxl_detach_process(ctx));
+ flush_work(&ctx->fault_work); /* Only needed for dedicated process */
+ put_pid(ctx->pid);
+ cxl_ctx_put();
return 0;
}
return;
afu_release_irqs(ctx, ctx);
- flush_work(&ctx->fault_work); /* Only needed for dedicated process */
wake_up_all(&ctx->wq);
}
free_page((u64)ctx->sstp);
ctx->sstp = NULL;
- put_pid(ctx->pid);
kfree(ctx);
}
*/
cxl_context_free(ctx);
- cxl_ctx_put();
return 0;
}