Skip to content

Commit 33fe111

Browse files
ShuichengLinmattrope
authored andcommitted
drm/xe/madvise: Fix ioctl argument check
It is "preferred_mem_loc" instead of "atomic" for the ATTR_PREFERRED_LOC path. Also include 2 minor changes with no functional impact. 1. Remove the redundant "attr.atomic_access" assignment. 2. Replace down_read_interruptible() with xe_svm_notifier_lock_interruptible() to pair with xe_svm_notifier_unlock(). Fixes: ada7486 ("drm/xe: Implement madvise ioctl for xe") Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://lore.kernel.org/r/20250911173139.1405878-2-shuicheng.lin@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
1 parent 5959c4d commit 33fe111

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/gpu/drm/xe/xe_vm_madvise.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ static void madvise_atomic(struct xe_device *xe, struct xe_vm *vm,
124124
vmas[i]->attr.atomic_access = op->atomic.val;
125125
}
126126

127-
vmas[i]->attr.atomic_access = op->atomic.val;
128-
129127
bo = xe_vma_bo(vmas[i]);
130128
if (!bo || bo->attr.atomic_access == op->atomic.val)
131129
continue;
@@ -253,7 +251,7 @@ static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madv
253251
if (XE_IOCTL_DBG(xe, args->preferred_mem_loc.pad))
254252
return false;
255253

256-
if (XE_IOCTL_DBG(xe, args->atomic.reserved))
254+
if (XE_IOCTL_DBG(xe, args->preferred_mem_loc.reserved))
257255
return false;
258256
break;
259257
}
@@ -407,7 +405,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
407405
}
408406

409407
if (madvise_range.has_svm_userptr_vmas) {
410-
err = down_read_interruptible(&vm->svm.gpusvm.notifier_lock);
408+
err = xe_svm_notifier_lock_interruptible(vm);
411409
if (err)
412410
goto err_fini;
413411
}

0 commit comments

Comments
 (0)