If unmapping partial range, the parent prange list op is update notifier, child range list op is unmap range, need check child range to set drain retry fault flag. Signed-off-by: Philip Yang <Philip.Yang@xxxxxxx> --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c index 77239b06b236..64f642935600 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c @@ -2049,8 +2049,19 @@ svm_range_add_list_work(struct svm_range_list *svms, struct svm_range *prange, * before the range is freed to avoid straggler interrupts on * unmapped memory causing "phantom faults". */ - if (op == SVM_OP_UNMAP_RANGE) + if (op == SVM_OP_UNMAP_RANGE) { + pr_debug("set range drain_pagefaults true\n"); svms->drain_pagefaults = true; + } else { + struct svm_range *pchild; + + list_for_each_entry(pchild, &prange->child_list, child_list) + if (pchild->work_item.op == SVM_OP_UNMAP_RANGE) { + pr_debug("set child drain_pagefaults true\n"); + svms->drain_pagefaults = true; + } + } + /* if prange is on the deferred list */ if (!list_empty(&prange->deferred_list)) { pr_debug("update exist prange 0x%p work op %d\n", prange, op); -- 2.17.1