Re: [PATCH] drm/amdgpu: Check the memory can be accesssed by ttm_device_clear_dma_mappings.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 16, 2021 at 10:25 AM Surbhi Kakarya <surbhi.kakarya@xxxxxxx> wrote:
>
> 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: skakarya <Surbhi.Kakarya@xxxxxxx>

Acked-by: Alex Deucher <alexander.deucher@xxxxxxx>

> 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
>



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux