Skip to content

Commit add38f8

Browse files
kwachowsjlawryno
authored andcommitted
accel/ivpu: Clear CDTAB entry in case of failure
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 <[email protected]> Reviewed-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 94b2a2c commit add38f8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/accel/ivpu/ivpu_mmu.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,17 @@ static int ivpu_mmu_cdtab_entry_set(struct ivpu_device *vdev, u32 ssid, u64 cd_d
749749

750750
ret = ivpu_mmu_cmdq_write_cfgi_all(vdev);
751751
if (ret)
752-
goto unlock;
752+
goto err_invalidate;
753753

754754
ret = ivpu_mmu_cmdq_sync(vdev);
755+
if (ret)
756+
goto err_invalidate;
755757
unlock:
758+
mutex_unlock(&mmu->lock);
759+
return 0;
760+
761+
err_invalidate:
762+
WRITE_ONCE(entry[0], 0);
756763
mutex_unlock(&mmu->lock);
757764
return ret;
758765
}

0 commit comments

Comments
 (0)