drm/amdgpu: fix userptr HMM range handling v2
authorChristian König <christian.koenig@amd.com>
Thu, 10 Nov 2022 11:31:41 +0000 (12:31 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Nov 2022 05:23:30 +0000 (00:23 -0500)
commitfec8fdb54e8f74d88951c9f998f47bf4f2031fe0
tree6488c4cbf8dedf902da012af243f8156d34a7be2
parent631945e04e1e243a503089f4487cad797476e8ca
drm/amdgpu: fix userptr HMM range handling v2

The basic problem here is that it's not allowed to page fault while
holding the reservation lock.

So it can happen that multiple processes try to validate an userptr
at the same time.

Work around that by putting the HMM range object into the mutex
protected bo list for now.

v2: make sure range is set to NULL in case of an error

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
CC: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h