Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon: fix the crash in test functions

radeon_copy_dma and radeon_copy_blit must be called with
a valid reservation object. Otherwise a crash will be provoked.
We borrow the object from vram BO.

bug:
https://bugs.freedesktop.org/show_bug.cgi?id=88464

Cc: stable@vger.kernel.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ilija Hadzic and committed by
Alex Deucher
92b712b7 3f5e1b4f

+4 -4
+4 -4
drivers/gpu/drm/radeon/radeon_test.c
··· 119 119 if (ring == R600_RING_TYPE_DMA_INDEX) 120 120 fence = radeon_copy_dma(rdev, gtt_addr, vram_addr, 121 121 size / RADEON_GPU_PAGE_SIZE, 122 - NULL); 122 + vram_obj->tbo.resv); 123 123 else 124 124 fence = radeon_copy_blit(rdev, gtt_addr, vram_addr, 125 125 size / RADEON_GPU_PAGE_SIZE, 126 - NULL); 126 + vram_obj->tbo.resv); 127 127 if (IS_ERR(fence)) { 128 128 DRM_ERROR("Failed GTT->VRAM copy %d\n", i); 129 129 r = PTR_ERR(fence); ··· 170 170 if (ring == R600_RING_TYPE_DMA_INDEX) 171 171 fence = radeon_copy_dma(rdev, vram_addr, gtt_addr, 172 172 size / RADEON_GPU_PAGE_SIZE, 173 - NULL); 173 + vram_obj->tbo.resv); 174 174 else 175 175 fence = radeon_copy_blit(rdev, vram_addr, gtt_addr, 176 176 size / RADEON_GPU_PAGE_SIZE, 177 - NULL); 177 + vram_obj->tbo.resv); 178 178 if (IS_ERR(fence)) { 179 179 DRM_ERROR("Failed VRAM->GTT copy %d\n", i); 180 180 r = PTR_ERR(fence);