Skip to content

Commit ecaa856

Browse files
EmilyDeng666gregkh
authored andcommitted
drm/amdgpu: Fix missing drain retry fault the last entry
[ Upstream commit fe2fa3b ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent c700730 commit ecaa856

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
@@ -3014,7 +3014,7 @@ svm_range_restore_pages(struct amdgpu_device *adev, unsigned int pasid,
30143014

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

0 commit comments

Comments
 (0)