aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Auld <[email protected]>2023-07-19 09:38:04 +0100
committerRodrigo Vivi <[email protected]>2023-12-21 11:37:35 -0500
commit2d30332a5ec004effe24d669003bf94e7f167387 (patch)
treec2a2afac4ecf852e103db32d939af3fa06ce54dd
parenta00b8f1aae43c46658de0f7f55d8a65acb002159 (diff)
drm/xe/vm: tidy up xe_runtime_pm usage
The xe_device_mem_access_get() should be all that's needed here and should now work as expected, without any strange races. In theory should be no functional changes here. Reported-by: Oded Gabbay <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Thomas Hellström <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_vm.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 2b9a7618b169..d4c6ddfce1ea 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -1245,11 +1245,8 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
INIT_LIST_HEAD(&vm->extobj.list);
- if (!(flags & XE_VM_FLAG_MIGRATION)) {
- /* We need to immeditatelly exit from any D3 state */
- xe_pm_runtime_get(xe);
+ if (!(flags & XE_VM_FLAG_MIGRATION))
xe_device_mem_access_get(xe);
- }
vm_resv_obj = drm_gpuvm_resv_object_alloc(&xe->drm);
if (!vm_resv_obj) {
@@ -1360,10 +1357,8 @@ err_close:
err_no_resv:
kfree(vm);
- if (!(flags & XE_VM_FLAG_MIGRATION)) {
+ if (!(flags & XE_VM_FLAG_MIGRATION))
xe_device_mem_access_put(xe);
- xe_pm_runtime_put(xe);
- }
return ERR_PTR(err);
}
@@ -1522,7 +1517,6 @@ static void vm_destroy_work_func(struct work_struct *w)
if (!(vm->flags & XE_VM_FLAG_MIGRATION)) {
xe_device_mem_access_put(xe);
- xe_pm_runtime_put(xe);
if (xe->info.has_asid) {
mutex_lock(&xe->usm.lock);