Skip to content

Commit 96af397

Browse files
committed
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 <matthew.auld@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: <stable@vger.kernel.org> # v6.8+ Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://lore.kernel.org/r/20250514152424.149591-3-matthew.auld@intel.com
1 parent 338ec84 commit 96af397

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
@@ -1704,8 +1704,10 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
17041704
* scheduler drops all the references of it, hence protecting the VM
17051705
* for this case is necessary.
17061706
*/
1707-
if (flags & XE_VM_FLAG_LR_MODE)
1707+
if (flags & XE_VM_FLAG_LR_MODE) {
1708+
INIT_WORK(&vm->preempt.rebind_work, preempt_rebind_work_func);
17081709
xe_pm_runtime_get_noresume(xe);
1710+
}
17091711

17101712
vm_resv_obj = drm_gpuvm_resv_object_alloc(&xe->drm);
17111713
if (!vm_resv_obj) {
@@ -1750,10 +1752,8 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
17501752
vm->batch_invalidate_tlb = true;
17511753
}
17521754

1753-
if (vm->flags & XE_VM_FLAG_LR_MODE) {
1754-
INIT_WORK(&vm->preempt.rebind_work, preempt_rebind_work_func);
1755+
if (vm->flags & XE_VM_FLAG_LR_MODE)
17551756
vm->batch_invalidate_tlb = false;
1756-
}
17571757

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

0 commit comments

Comments
 (0)