kref_put(&job->refcnt, aie2_job_release);
}
-static void aie2_hwctx_status_shift_stop(struct amdxdna_hwctx *hwctx)
-{
- hwctx->old_status = hwctx->status;
- hwctx->status = HWCTX_STAT_STOP;
-}
-
-static void aie2_hwctx_status_restore(struct amdxdna_hwctx *hwctx)
-{
- hwctx->status = hwctx->old_status;
-}
-
/* The bad_job is used in aie2_sched_job_timedout, otherwise, set it to NULL */
static void aie2_hwctx_stop(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwctx,
struct drm_sched_job *bad_job)
goto out;
}
- if (hwctx->status != HWCTX_STAT_READY) {
- XDNA_DBG(xdna, "hwctx is not ready, status %d", hwctx->status);
- goto out;
- }
-
ret = aie2_config_cu(hwctx, NULL);
if (ret) {
XDNA_ERR(xdna, "Config cu failed, ret %d", ret);
aie2_hwctx_wait_for_idle(hwctx);
aie2_hwctx_stop(xdna, hwctx, NULL);
- aie2_hwctx_status_shift_stop(hwctx);
return 0;
}
{
struct amdxdna_dev *xdna = hwctx->client->xdna;
- aie2_hwctx_status_restore(hwctx);
return aie2_hwctx_restart(xdna, hwctx);
}
struct dma_fence *fence;
int ret;
- if (hwctx->status != HWCTX_STAT_READY)
+ if (!hwctx->priv->mbox_chann)
return NULL;
if (!mmget_not_zero(job->mm))
}
amdxdna_pm_suspend_put(xdna);
- hwctx->status = HWCTX_STAT_INIT;
init_waitqueue_head(&priv->job_free_wq);
XDNA_DBG(xdna, "hwctx %s init completed", hwctx->name);
/* Request fw to destroy hwctx and cancel the rest pending requests */
drm_sched_stop(&hwctx->priv->sched, NULL);
aie2_release_resource(hwctx);
- hwctx->status = HWCTX_STAT_STOP;
drm_sched_start(&hwctx->priv->sched, 0);
mutex_unlock(&xdna->dev_lock);
if (XDNA_MBZ_DBG(xdna, config->pad, sizeof(config->pad)))
return -EINVAL;
- if (hwctx->status != HWCTX_STAT_INIT) {
+ if (hwctx->cus) {
XDNA_ERR(xdna, "Not support re-config CU");
return -EINVAL;
}
}
wmb(); /* To avoid locking in command submit when check status */
- hwctx->status = HWCTX_STAT_READY;
return 0;