Skip to content

Commit b6fd6e0

Browse files
Surbhi Kakaryaalexdeucher
authored andcommitted
drm/amdgpu: Check the memory can be accesssed by ttm_device_clear_dma_mappings.
If the event guard is enabled and VF doesn't receive an ack from PF for full access, the guest driver load crashes. This is caused due to the call to ttm_device_clear_dma_mappings with non-initialized mman during driver tear down. This patch adds the necessary condition to check if the mman initialization passed or not and takes the path based on the condition output. Signed-off-by: Surbhi Kakarya <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f89c6bf commit b6fd6e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3895,7 +3895,8 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
38953895

38963896
amdgpu_irq_fini_hw(adev);
38973897

3898-
ttm_device_clear_dma_mappings(&adev->mman.bdev);
3898+
if (adev->mman.initialized)
3899+
ttm_device_clear_dma_mappings(&adev->mman.bdev);
38993900

39003901
amdgpu_gart_dummy_page_fini(adev);
39013902

0 commit comments

Comments
 (0)