• Philip Yang's avatar
    drm/amdkfd: Handle errors from svm validate and map · eb3c357b
    Philip Yang authored
    If new range is splited to multiple pranges with max_svm_range_pages
    alignment and added to update_list, svm validate and map should keep
    going after error to make sure prange->mapped_to_gpu flag is up to date
    for the whole range.
    
    svm validate and map update set prange->mapped_to_gpu after mapping to
    GPUs successfully, otherwise clear prange->mapped_to_gpu flag (for
    update mapping case) instead of setting error flag, we can remove
    the redundant error flag to simpliy code.
    
    Refactor to remove goto and update prange->mapped_to_gpu flag inside
    svm_range_lock, to guarant we always evict queues or unmap from GPUs if
    there are invalid ranges.
    
    After svm validate and map return error -EAGIN, the caller retry will
    update the mapping for the whole range again.
    
    Fixes: c22b0440 ("drm/amdkfd: flag added to handle errors from svm validate and map")
    Signed-off-by: default avatarPhilip Yang <Philip.Yang@amd.com>
    Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Tested-by: default avatarJames Zhu <james.zhu@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    eb3c357b
kfd_svm.h 9.24 KB