1
0

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: ada7486c56 ("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>
This commit is contained in:
Shuicheng Lin
2025-09-11 17:31:40 +00:00
committed by Matt Roper
parent 5959c4da17
commit 33fe111a35

View File

@@ -124,8 +124,6 @@ static void madvise_atomic(struct xe_device *xe, struct xe_vm *vm,
vmas[i]->attr.atomic_access = op->atomic.val;
}
vmas[i]->attr.atomic_access = op->atomic.val;
bo = xe_vma_bo(vmas[i]);
if (!bo || bo->attr.atomic_access == op->atomic.val)
continue;
@@ -253,7 +251,7 @@ static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madv
if (XE_IOCTL_DBG(xe, args->preferred_mem_loc.pad))
return false;
if (XE_IOCTL_DBG(xe, args->atomic.reserved))
if (XE_IOCTL_DBG(xe, args->preferred_mem_loc.reserved))
return false;
break;
}
@@ -407,7 +405,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
}
if (madvise_range.has_svm_userptr_vmas) {
err = down_read_interruptible(&vm->svm.gpusvm.notifier_lock);
err = xe_svm_notifier_lock_interruptible(vm);
if (err)
goto err_fini;
}