Lines Matching refs:afu
37 int cxl_afu_slbia(struct cxl_afu *afu)
42 cxl_p2n_write(afu, CXL_SLBIA_An, CXL_TLB_SLB_IQ_ALL);
43 while (cxl_p2n_read(afu, CXL_SLBIA_An) & CXL_TLB_SLB_P) {
45 dev_warn(&afu->dev, "WARNING: CXL AFU SLBIA timed out!\n");
51 if (!cxl_ops->link_ok(afu->adapter, afu))
65 pr_devel("%s matched mm - card: %i afu: %i pe: %i\n", __func__,
66 ctx->afu->adapter->adapter_num, ctx->afu->slice, ctx->pe);
73 cxl_afu_slbia(ctx->afu);
79 struct cxl_afu *afu;
90 afu = adapter->afu[slice];
91 if (!afu || !afu->enabled)
94 idr_for_each_entry(&afu->contexts_idr, ctx, id)
246 struct cxl_afu *afu;
248 if (!(afu = kzalloc(sizeof(struct cxl_afu), GFP_KERNEL)))
251 afu->adapter = adapter;
252 afu->dev.parent = &adapter->dev;
253 afu->dev.release = cxl_ops->release_afu;
254 afu->slice = slice;
255 idr_init(&afu->contexts_idr);
256 mutex_init(&afu->contexts_lock);
257 spin_lock_init(&afu->afu_cntl_lock);
258 atomic_set(&afu->configured_state, -1);
259 afu->prefault_mode = CXL_PREFAULT_NONE;
260 afu->irqs_max = afu->adapter->user_irqs;
262 return afu;
265 int cxl_afu_select_best_mode(struct cxl_afu *afu)
267 if (afu->modes_supported & CXL_MODE_DIRECTED)
268 return cxl_ops->afu_activate_mode(afu, CXL_MODE_DIRECTED);
270 if (afu->modes_supported & CXL_MODE_DEDICATED)
271 return cxl_ops->afu_activate_mode(afu, CXL_MODE_DEDICATED);
273 dev_warn(&afu->dev, "No supported programming modes available\n");