Skip to content

Commit a63e99b

Browse files
matt-auldThomas Hellström
authored andcommitted
drm/xe/vm: move rebind_work init earlier
In xe_vm_close_and_put() we need to be able to call flush_work(rebind_work), however during vm creation we can call this on the error path, before having actually set up the worker, leading to a splat from flush_work(). It looks like we can simply move the worker init step earlier to fix this. Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Matthew Auld <[email protected]> Cc: Matthew Brost <[email protected]> Cc: <[email protected]> # v6.8+ Reviewed-by: Matthew Brost <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit 96af397) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 40493d9 commit a63e99b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/xe/xe_vm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,8 +1678,10 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
16781678
* scheduler drops all the references of it, hence protecting the VM
16791679
* for this case is necessary.
16801680
*/
1681-
if (flags & XE_VM_FLAG_LR_MODE)
1681+
if (flags & XE_VM_FLAG_LR_MODE) {
1682+
INIT_WORK(&vm->preempt.rebind_work, preempt_rebind_work_func);
16821683
xe_pm_runtime_get_noresume(xe);
1684+
}
16831685

16841686
vm_resv_obj = drm_gpuvm_resv_object_alloc(&xe->drm);
16851687
if (!vm_resv_obj) {
@@ -1724,10 +1726,8 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
17241726
vm->batch_invalidate_tlb = true;
17251727
}
17261728

1727-
if (vm->flags & XE_VM_FLAG_LR_MODE) {
1728-
INIT_WORK(&vm->preempt.rebind_work, preempt_rebind_work_func);
1729+
if (vm->flags & XE_VM_FLAG_LR_MODE)
17291730
vm->batch_invalidate_tlb = false;
1730-
}
17311731

17321732
/* Fill pt_root after allocating scratch tables */
17331733
for_each_tile(tile, xe, id) {

0 commit comments

Comments
 (0)