Skip to content

Commit

Permalink
accel/ivpu: Clear CDTAB entry in case of failure
Browse files Browse the repository at this point in the history
Don't leave a context descriptor in case CFGI_ALL flush fails.
Mark it as invalid (by clearing valid bit) so nothing is left in
partially-initialized state.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-5-jacek.lawrynowicz@linux.intel.com
  • Loading branch information
Karol Wachowski authored and Jacek Lawrynowicz committed Oct 30, 2024
1 parent 94b2a2c commit add38f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/accel/ivpu/ivpu_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,17 @@ static int ivpu_mmu_cdtab_entry_set(struct ivpu_device *vdev, u32 ssid, u64 cd_d

ret = ivpu_mmu_cmdq_write_cfgi_all(vdev);
if (ret)
goto unlock;
goto err_invalidate;

ret = ivpu_mmu_cmdq_sync(vdev);
if (ret)
goto err_invalidate;
unlock:
mutex_unlock(&mmu->lock);
return 0;

err_invalidate:
WRITE_ONCE(entry[0], 0);
mutex_unlock(&mmu->lock);
return ret;
}
Expand Down

0 comments on commit add38f8

Please sign in to comment.