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