Lines Matching refs:afu
35 int cxl_context_init(struct cxl_context *ctx, struct cxl_afu *afu, bool master) in cxl_context_init() argument
39 ctx->afu = afu; in cxl_context_init()
92 mutex_lock(&afu->contexts_lock); in cxl_context_init()
94 i = idr_alloc(&ctx->afu->contexts_idr, ctx, 0, in cxl_context_init()
95 ctx->afu->num_procs, GFP_NOWAIT); in cxl_context_init()
97 mutex_unlock(&afu->contexts_lock); in cxl_context_init()
103 ctx->elem = &ctx->afu->native->spa[i]; in cxl_context_init()
114 cxl_afu_get(afu); in cxl_context_init()
138 if (ctx->afu->current_mode == CXL_MODE_DEDICATED) { in cxl_mmap_fault()
139 area = ctx->afu->psn_phys; in cxl_mmap_fault()
140 if (offset >= ctx->afu->adapter->ps_size) in cxl_mmap_fault()
187 if (ctx->afu->current_mode == CXL_MODE_DEDICATED) { in cxl_context_iomap()
188 if (start + len > ctx->afu->adapter->ps_size) in cxl_context_iomap()
196 if (ctx->master && !ctx->afu->psa) { in cxl_context_iomap()
202 if (!ctx->afu->enabled) in cxl_context_iomap()
210 if ((ctx->master && !ctx->afu->psa) || (!ctx->afu->pp_psa)) { in cxl_context_iomap()
216 if (!ctx->afu->enabled) in cxl_context_iomap()
249 cxl_ops->link_ok(ctx->afu->adapter, ctx->afu)); in __detach_context()
265 cxl_adapter_context_put(ctx->afu->adapter); in __detach_context()
297 void cxl_context_detach_all(struct cxl_afu *afu) in cxl_context_detach_all() argument
302 mutex_lock(&afu->contexts_lock); in cxl_context_detach_all()
303 idr_for_each_entry(&afu->contexts_idr, ctx, tmp) { in cxl_context_detach_all()
321 mutex_unlock(&afu->contexts_lock); in cxl_context_detach_all()
337 cxl_afu_put(ctx->afu); in reclaim_ctx()
346 mutex_lock(&ctx->afu->contexts_lock); in cxl_context_free()
347 idr_remove(&ctx->afu->contexts_idr, ctx->pe); in cxl_context_free()
348 mutex_unlock(&ctx->afu->contexts_lock); in cxl_context_free()