diff options
| author | Matthew Brost <matthew.brost@intel.com> | 2025-11-21 17:25:01 -0800 |
|---|---|---|
| committer | Matthew Brost <matthew.brost@intel.com> | 2025-11-26 10:21:45 -0800 |
| commit | 9fb1f1256e419fcd0e5000ea8aaa71a65575a90b (patch) | |
| tree | 45a47f9bea079b7bf7a573e65cdfc4fdfafc7a8f /drivers/gpu | |
| parent | dacda0cf75d5f4aa8da5404c21dc8ab4b7667799 (diff) | |
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: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Link: https://patch.msgid.link/20251122012502.382587-1-matthew.brost@intel.com
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/drm_gpusvm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_gpusvm.c b/drivers/gpu/drm/drm_gpusvm.c index 73e550c8ff8c..39c8c50401dd 100644 --- a/drivers/gpu/drm/drm_gpusvm.c +++ b/drivers/gpu/drm/drm_gpusvm.c @@ -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; |
