Skip to content

Commit fe2fa3b

Browse files
EmilyDeng666alexdeucher
authored andcommitted
drm/amdgpu: Fix missing drain retry fault the last entry
While the entry get in svm_range_unmap_from_cpu is the last entry, and the entry is page fault, it also need to be dropped. So for equal case, it also need to be dropped. v2: Only modify the svm_range_restore_pages. Signed-off-by: Emily Deng <[email protected]> Reviewed-by: Xiaogang Chen<[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 94b0908 commit fe2fa3b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ struct amdgpu_ih_ring {
7878
#define amdgpu_ih_ts_after(t1, t2) \
7979
(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) > 0LL)
8080

81+
#define amdgpu_ih_ts_after_or_equal(t1, t2) \
82+
(((int64_t)((t2) << 16) - (int64_t)((t1) << 16)) >= 0LL)
83+
8184
/* provided by the ih block */
8285
struct amdgpu_ih_funcs {
8386
/* ring read/write ptr handling, called from interrupt context */

drivers/gpu/drm/amd/amdkfd/kfd_svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@ svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid,
30113011

30123012
/* check if this page fault time stamp is before svms->checkpoint_ts */
30133013
if (svms->checkpoint_ts[gpuidx] != 0) {
3014-
if (amdgpu_ih_ts_after(ts, svms->checkpoint_ts[gpuidx])) {
3014+
if (amdgpu_ih_ts_after_or_equal(ts, svms->checkpoint_ts[gpuidx])) {
30153015
pr_debug("draining retry fault, drop fault 0x%llx\n", addr);
30163016
r = 0;
30173017
goto out;

0 commit comments

Comments
 (0)