Skip to content

Commit a3940ea

Browse files
committed
drm/amdkfd: flag added to handle errors from svm validate and map
If a return error is raised during validation and mapping of a prange, this flag is set. It is a rare occurrence, but it could happen when `amdgpu_hmm_range_get_pages_done` returns true. In such cases, the caller should retry. However, it is important to ensure that the prange is updated correctly during the retry. Signed-off-by: Alex Sierra <[email protected]> Reviewed-by: Felix Kuehling <[email protected]>
1 parent 79673f8 commit a3940ea

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ svm_range_is_same_attrs(struct kfd_process *p, struct svm_range *prange,
821821
}
822822
}
823823

824-
return true;
824+
return !prange->is_error_flag;
825825
}
826826

827827
/**
@@ -1655,6 +1655,7 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
16551655
unreserve_out:
16561656
svm_range_unreserve_bos(&ctx);
16571657

1658+
prange->is_error_flag = !!r;
16581659
if (!r)
16591660
prange->validate_timestamp = ktime_get_boottime();
16601661

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ struct svm_range {
133133
DECLARE_BITMAP(bitmap_aip, MAX_GPU_INSTANCE);
134134
bool validated_once;
135135
bool mapped_to_gpu;
136+
bool is_error_flag;
136137
};
137138

138139
static inline void svm_range_lock(struct svm_range *prange)

0 commit comments

Comments
 (0)