diff --git a/src/runtime_src/core/edge/drm/zocl/edge/zocl_aie.c b/src/runtime_src/core/edge/drm/zocl/edge/zocl_aie.c index cc8fa3bc7b..9be7cc55d9 100644 --- a/src/runtime_src/core/edge/drm/zocl/edge/zocl_aie.c +++ b/src/runtime_src/core/edge/drm/zocl/edge/zocl_aie.c @@ -182,6 +182,7 @@ static struct drm_zocl_slot* get_slot(struct drm_zocl_dev * zdev, struct kds_client* client, int hw_ctx_id) { int slot_idx = 0; + int i = 0; struct drm_zocl_slot* slot = NULL; struct kds_client_hw_ctx *kds_hw_ctx = NULL; mutex_lock(&client->lock); @@ -192,10 +193,20 @@ get_slot(struct drm_zocl_dev * zdev, struct kds_client* client, int hw_ctx_id) if (slot_idx >= MAX_PR_SLOT_NUM) { DRM_ERROR("%s: Invalid client", __func__); + mutex_unlock(&client->lock); return NULL; } slot = zdev->pr_slot[slot_idx]; + // WorkAround for older flows where there is single slot for AIE + if (!slot || !slot->aie) { + for (i = 0; i < MAX_PR_SLOT_NUM; i++) { + slot = zdev->pr_slot[i]; + if (slot && slot->aie) + break; + } + } + mutex_unlock(&client->lock); return slot; } diff --git a/src/runtime_src/core/edge/drm/zocl/edge/zocl_edge_xclbin.c b/src/runtime_src/core/edge/drm/zocl/edge/zocl_edge_xclbin.c index bc4b5606b0..fa503fa7e0 100644 --- a/src/runtime_src/core/edge/drm/zocl/edge/zocl_edge_xclbin.c +++ b/src/runtime_src/core/edge/drm/zocl/edge/zocl_edge_xclbin.c @@ -163,7 +163,7 @@ zocl_xclbin_read_axlf(struct drm_zocl_dev *zdev, struct drm_zocl_axlf *axlf_obj, // We come here if user sets force_xclbin_program // option "true" in xrt.ini under [Runtime] section DRM_WARN("%s Force xclbin download", __func__); - } else { + } else if (!is_aie_only(axlf)) { DRM_INFO("xclbin already downloaded to slot=%d", slot_id); vfree(axlf); mutex_unlock(&slot->slot_xclbin_lock); @@ -214,7 +214,6 @@ zocl_xclbin_read_axlf(struct drm_zocl_dev *zdev, struct drm_zocl_axlf *axlf_obj, } else #endif if (is_aie_only(axlf)) { - zocl_cleanup_aie(slot); ret = zocl_load_aie_only_pdi(zdev, slot, axlf, xclbin, client); if (ret)