[PATCH] drm/amdgpu: fix warning of drm_mm_clean
Yin, ZhenGuo (Chris)
ZhenGuo.Yin at amd.com
Tue Apr 1 03:41:25 UTC 2025
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Leslie
Any comment on this?
Looks like you add this code 3 years ago on patch: drm/amdgpu: Unmap MMIO mappings when device is not unplugged
Best,
Zhenguo
Cloud-GPU Core team, SRDC
-----Original Message-----
From: Koenig, Christian <Christian.Koenig at amd.com>
Sent: Monday, March 31, 2025 8:07 PM
To: Yin, ZhenGuo (Chris) <ZhenGuo.Yin at amd.com>; amd-gfx at lists.freedesktop.org
Cc: Sharma, Shashank <Shashank.Sharma at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: Re: [PATCH] drm/amdgpu: fix warning of drm_mm_clean
Am 31.03.25 um 13:26 schrieb ZhenGuo Yin:
> Kernel doorbell BOs needs to be freed before ttm_fini.
Good catch, but does anybody remember why we have the drm_dev_enter()/drm_dev_exit() here?
It's clearly for hotplug, but it doesn't make sense to have the amdgpu_doorbell_fini() under it as far as I can see.
Regards,
Christian.
>
> Fixes: 54c30d2a8def ("drm/amdgpu: create kernel doorbell pages")
> Signed-off-by: ZhenGuo Yin <zhenguo.yin at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index d4b01ef00025..b49604ade6c2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -4807,6 +4807,13 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)
> int i, idx;
> bool px;
>
> + if (drm_dev_enter(adev_to_drm(adev), &idx)) {
> + iounmap(adev->rmmio);
> + adev->rmmio = NULL;
> + amdgpu_doorbell_fini(adev);
> + drm_dev_exit(idx);
> + }
> +
> amdgpu_device_ip_fini(adev);
> amdgpu_fence_driver_sw_fini(adev);
> amdgpu_ucode_release(&adev->firmware.gpu_info_fw);
> @@ -4847,14 +4854,6 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)
> if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
> vga_client_unregister(adev->pdev);
>
> - if (drm_dev_enter(adev_to_drm(adev), &idx)) {
> -
> - iounmap(adev->rmmio);
> - adev->rmmio = NULL;
> - amdgpu_doorbell_fini(adev);
> - drm_dev_exit(idx);
> - }
> -
> if (IS_ENABLED(CONFIG_PERF_EVENTS))
> amdgpu_pmu_fini(adev);
> if (adev->mman.discovery_bin)
More information about the amd-gfx
mailing list