[PATCH] drm/amd/amdgpu:flush ttm delayed work before cancel_sync

Andrey Grodzovsky andrey.grodzovsky at amd.com
Tue Aug 17 16:54:06 UTC 2021


Looks reasonable to me.

Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky at amd.com>

Andrey

On 2021-08-17 5:50 a.m., YuBiao Wang wrote:
> [Why]
> In some cases when we unload driver, warning call trace
> will show up in vram_mgr_fini which claims that LRU is not empty, caused
> by the ttm bo inside delay deleted queue.
>
> [How]
> We should flush delayed work to make sure the delay deleting is done.
>
> Signed-off-by: YuBiao Wang <YuBiao.Wang at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4d266c40382c..0b5764aa98a4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3824,8 +3824,10 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
>   {
>   	dev_info(adev->dev, "amdgpu: finishing device.\n");
>   	flush_delayed_work(&adev->delayed_init_work);
> -	if (adev->mman.initialized)
> +	if (adev->mman.initialized) {
> +		flush_delayed_work(&adev->mman.bdev.wq);
>   		ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
> +	}
>   	adev->shutdown = true;
>   
>   	/* make sure IB test finished before entering exclusive mode


More information about the amd-gfx mailing list
  翻译: