Lines Matching defs:afu
36 int cxl_afu_slbia(struct cxl_afu *afu)
41 cxl_p2n_write(afu, CXL_SLBIA_An, CXL_TLB_SLB_IQ_ALL);
42 while (cxl_p2n_read(afu, CXL_SLBIA_An) & CXL_TLB_SLB_P) {
44 dev_warn(&afu->dev, "WARNING: CXL AFU SLBIA timed out!\n");
50 if (!cxl_ops->link_ok(afu->adapter, afu))
64 pr_devel("%s matched mm - card: %i afu: %i pe: %i\n", __func__,
65 ctx->afu->adapter->adapter_num, ctx->afu->slice, ctx->pe);
72 cxl_afu_slbia(ctx->afu);
78 struct cxl_afu *afu;
89 afu = adapter->afu[slice];
90 if (!afu || !afu->enabled)
93 idr_for_each_entry(&afu->contexts_idr, ctx, id)
245 struct cxl_afu *afu;
247 if (!(afu = kzalloc(sizeof(struct cxl_afu), GFP_KERNEL)))
250 afu->adapter = adapter;
251 afu->dev.parent = &adapter->dev;
252 afu->dev.release = cxl_ops->release_afu;
253 afu->slice = slice;
254 idr_init(&afu->contexts_idr);
255 mutex_init(&afu->contexts_lock);
256 spin_lock_init(&afu->afu_cntl_lock);
257 atomic_set(&afu->configured_state, -1);
258 afu->prefault_mode = CXL_PREFAULT_NONE;
259 afu->irqs_max = afu->adapter->user_irqs;
261 return afu;
264 int cxl_afu_select_best_mode(struct cxl_afu *afu)
266 if (afu->modes_supported & CXL_MODE_DIRECTED)
267 return cxl_ops->afu_activate_mode(afu, CXL_MODE_DIRECTED);
269 if (afu->modes_supported & CXL_MODE_DEDICATED)
270 return cxl_ops->afu_activate_mode(afu, CXL_MODE_DEDICATED);
272 dev_warn(&afu->dev, "No supported programming modes available\n");