[PATCH] drm/amdgpu: fix a call trace when unload amdgpu driver

Song, Asher Asher.Song at amd.com
Wed Sep 4 08:02:36 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

On Tuesday, September 3, 2024 9:29 PM wrote by Koenig, Christian
> Am 03.09.24 um 14:31 schrieb Asher Song:
> > In some APUs, the bo type of GART page table is ttm_bo_type_sg.
> > Those type BOs is released by bo->delayed_delete which is added in
> > ttm_device->wq, not released immediately.
> >
> > To make sure all the ttm_resource is released before
> > ttm_resource_manager is finilized, drain the workqueue in ttm_device.
> >
> > Fixes:d99fbd9aab62 ("drm/ttm: Always take the bo delayed cleanup path
> > for imported bos")
> > Acked-by: Christian König <christian.koenig at amd.com>
>
> The correct tag is Suggested-by.
>
> > Signed-off-by: Asher Song <Asher.Song at amd.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> > b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> > index 0a5c8d97787a..99017e426618 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> > @@ -2216,6 +2216,7 @@ static int gmc_v9_0_sw_fini(void *handle)
> >     if (!adev->gmc.real_vram_size) {
> >             dev_info(adev->dev, "Put GART in system memory for APU
> free\n");
> >             amdgpu_gart_table_ram_free(adev);
> > +           drain_workqueue(adev->mman.bdev.wq);
>
> That is certainly incorrectly placed in the gmc_v9_0_sw_fini(). That should be
> somewhere in amdgpu_ttm.c
>
> Regards,
> Christian.
>

Thank you. Will send v2 to place drain_workqueue in amdgpu_ttm.c

Best Regards,
Asher
> >     } else {
> >             amdgpu_gart_table_vram_free(adev);
> >     }



More information about the amd-gfx mailing list