Lines Matching defs:hdev
60 static void hl_encaps_sig_mgr_fini(struct hl_device *hdev, struct hl_encaps_signals_mgr *mgr)
72 dev_warn(hdev->dev,
83 struct hl_device *hdev = ctx->hdev;
99 for (i = 0 ; i < hdev->asic_prop.max_pending_cs ; i++)
105 dev_dbg(hdev->dev, "closing user context %d\n", ctx->asid);
111 if (hdev->in_debug)
112 hl_device_set_debug_mode(hdev, ctx, false);
114 hdev->asic_funcs->ctx_fini(ctx);
120 hl_asid_free(hdev, ctx->asid);
121 hl_encaps_sig_mgr_fini(hdev, &ctx->sig_mgr);
123 dev_dbg(hdev->dev, "closing kernel context\n");
124 hdev->asic_funcs->ctx_fini(ctx);
151 int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv)
168 dev_err(hdev->dev, "Failed to allocate IDR for a new CTX\n");
174 rc = hl_ctx_init(hdev, ctx, false);
185 hdev->is_compute_ctx_active = true;
199 int hl_ctx_init(struct hl_device *hdev, struct hl_ctx *ctx, bool is_kernel_ctx)
203 ctx->hdev = hdev;
211 ctx->cs_pending = kcalloc(hdev->asic_prop.max_pending_cs,
230 dev_err(hdev->dev, "Failed to init mem ctx module\n");
235 rc = hdev->asic_funcs->ctx_init(ctx);
237 dev_err(hdev->dev, "ctx_init failed\n");
241 ctx->asid = hl_asid_alloc(hdev);
243 dev_err(hdev->dev, "No free ASID, failed to create context\n");
250 dev_err(hdev->dev, "Failed to init mem ctx module\n");
257 dev_err(hdev->dev,
262 rc = hdev->asic_funcs->ctx_init(ctx);
264 dev_err(hdev->dev, "ctx_init failed\n");
270 dev_dbg(hdev->dev, "create user context %d\n", ctx->asid);
281 hl_asid_free(hdev, ctx->asid);
304 struct hl_ctx *hl_get_compute_ctx(struct hl_device *hdev)
309 mutex_lock(&hdev->fpriv_list_lock);
311 list_for_each_entry(hpriv, &hdev->fpriv_list, dev_node) {
324 mutex_unlock(&hdev->fpriv_list_lock);
342 struct asic_fixed_properties *asic_prop = &ctx->hdev->asic_prop;
393 dev_err(ctx->hdev->dev,
426 * @hdev: pointer to device structure
432 void hl_ctx_mgr_fini(struct hl_device *hdev, struct hl_ctx_mgr *ctx_mgr)