Lines Matching refs:ctx
743 struct hl_ctx *ctx = hl_get_compute_ctx(hdev);
745 if (ctx) {
751 kref_read(&ctx->refcount) - 1, HL_PENDING_RESET_PER_SEC);
752 hl_ctx_put(ctx);
1123 int hl_device_set_debug_mode(struct hl_device *hdev, struct hl_ctx *ctx, bool enable)
1138 hdev->asic_funcs->halt_coresight(hdev, ctx);
1498 struct hl_ctx *ctx;
1682 ctx = hl_get_compute_ctx(hdev);
1683 if (ctx) {
1684 atomic_set(&ctx->thread_ctx_switch_token, 1);
1685 ctx->thread_ctx_switch_wait_token = 0;
1686 hl_ctx_put(ctx);
1714 "%s kernel ctx was alive during hard reset, something is terribly wrong\n",
1741 "failed to init kernel ctx in hard reset\n");
1909 struct hl_ctx *ctx = NULL;
1921 ctx = hl_get_compute_ctx(hdev);
1922 if (!ctx || !ctx->hpriv->notifier_event.eventfd)
1948 hl_ctx_put(ctx);
1957 if (ctx)
1958 hl_ctx_put(ctx);
2306 "kernel ctx is still alive on initialization failure\n");
2453 dev_err(hdev->dev, "kernel ctx is still alive\n");
2570 struct hl_ctx *ctx;
2577 ctx = hl_get_compute_ctx(hdev);
2578 if (!ctx) {
2583 mutex_lock(&ctx->mem_hash_lock);
2584 hash_for_each(ctx->mem_hash, i, hnode, node) {
2606 hash_for_each(ctx->mem_hash, i, hnode, node) {
2621 mutex_unlock(&ctx->mem_hash_lock);
2622 hl_ctx_put(ctx);