Commit 9fb1f125 authored by Matthew Brost's avatar Matthew Brost
Browse files

drm/gpusvm: Limit the number of retries in drm_gpusvm_get_pages



drm_gpusvm_get_pages should not be allowed to retry forever, cap the
time spent in the function to HMM_RANGE_DEFAULT_TIMEOUT has this is
essentially a wrapper around hmm_range_fault.

Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patch.msgid.link/20251122012502.382587-1-matthew.brost@intel.com
parent dacda0cf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1288,6 +1288,9 @@ int drm_gpusvm_get_pages(struct drm_gpusvm *gpusvm,
							   DMA_BIDIRECTIONAL;

retry:
	if (time_after(jiffies, timeout))
		return -EBUSY;

	hmm_range.notifier_seq = mmu_interval_read_begin(notifier);
	if (drm_gpusvm_pages_valid_unlocked(gpusvm, svm_pages))
		goto set_seqno;