drm/amdgpu: Check the memory can be accesssed by ttm_device_clear_dma_mappings.
authorSurbhi Kakarya <surbhi.kakarya@amd.com>
Fri, 17 Dec 2021 17:01:09 +0000 (12:01 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Dec 2021 13:54:43 +0000 (08:54 -0500)
commitb6fd6e0f5eb8c6d10575d08a2c6df8ed83877e07
treed24137d3a233be02f4b5257b060ee34c240d26e9
parentf89c6bf73420c597769033dcc811ce691597ccf3
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 <Surbhi.Kakarya@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c