[PATCH] drm/amdgpu/sriov : Check the memory can be accesssed by ttm_device_clear_dma_mappings.
Alex Deucher
alexdeucher at gmail.com
Thu Dec 16 14:44:03 UTC 2021
On Tue, Dec 14, 2021 at 12:44 PM Surbhi Kakarya <surbhi.kakarya at amd.com> wrote:
>
> On SRIOV environment, if 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.
Is this actually sr-iov specific? I think any failure that happens
before ttm is set up would hit this. So I think the wording could be
updated to drop the SR-IOV.
Alex
>
> Signed-off-by: skakarya <Surbhi.Kakarya at amd.com>
> Change-Id: I1c18c7eb3500687c8b6e7fc414503dcf2a20b94c
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 598250a380f5..226110be7a2f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3984,7 +3984,8 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
>
> amdgpu_irq_fini_hw(adev);
>
> - ttm_device_clear_dma_mappings(&adev->mman.bdev);
> + if (adev->mman.initialized)
> + ttm_device_clear_dma_mappings(&adev->mman.bdev);
>
> amdgpu_gart_dummy_page_fini(adev);
>
> --
> 2.25.1
>
More information about the amd-gfx
mailing list