]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: fix dma mapping leaking warning
authorPhilip Yang <Philip.Yang@amd.com>
Tue, 14 Sep 2021 20:33:40 +0000 (16:33 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 23 Sep 2021 20:00:16 +0000 (16:00 -0400)
commitc1c118e102bd101e80420302960accdc3494888f
treec000570c30acca30d7aa23a770c20c24d9628095
parent9f14d2e11505b2e2f240e892ee01134ff074fb87
drm/amdkfd: fix dma mapping leaking warning

For xnack off, restore work dma unmap previous system memory page, and
dma map the updated system memory page to update GPU mapping, this is
not dma mapping leaking, remove the WARN_ONCE for dma mapping leaking.

prange->dma_addr store the VRAM page pfn after the range migrated to
VRAM, should not dma unmap VRAM page when updating GPU mapping or
remove prange. Add helper svm_is_valid_dma_mapping_addr to check VRAM
page and error cases.

Mask out SVM_RANGE_VRAM_DOMAIN flag in dma_addr before calling amdgpu vm
update to avoid BUG_ON(*addr & 0xFFFF00000000003FULL), and set it again
immediately after. This flag is used to know the type of page later to
dma unmapping system memory page.

Fixes: 603dc655f06f ("drm/amdkfd: classify and map mixed svm range pages in GPU")
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c