[PATCH] drm/amd/amdgpu: skip locking delayed work if not initialized.

Deng, Emily Emily.Deng at amd.com
Mon Aug 9 09:49:07 UTC 2021


[AMD Official Use Only]

Reviewed-by: Emily.Deng <Emily.Deng at amd.com>

>-----Original Message-----
>From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
>YuBiao Wang
>Sent: Thursday, August 5, 2021 10:38 AM
>To: amd-gfx at lists.freedesktop.org
>Cc: Grodzovsky, Andrey <Andrey.Grodzovsky at amd.com>; Quan, Evan
><Evan.Quan at amd.com>; Chen, Horace <Horace.Chen at amd.com>; Tuikov,
>Luben <Luben.Tuikov at amd.com>; Koenig, Christian
><Christian.Koenig at amd.com>; Deucher, Alexander
><Alexander.Deucher at amd.com>; Xiao, Jack <Jack.Xiao at amd.com>; Zhang,
>Hawking <Hawking.Zhang at amd.com>; Liu, Monk <Monk.Liu at amd.com>; Xu,
>Feifei <Feifei.Xu at amd.com>; Wang, Kevin(Yang) <Kevin1.Wang at amd.com>;
>Wang, YuBiao <YuBiao.Wang at amd.com>
>Subject: [PATCH] drm/amd/amdgpu: skip locking delayed work if not
>initialized.
>
>When init failed in early init stage, amdgpu_object has not been initialized,
>so hasn't the ttm delayed queue functions.
>
>Signed-off-by: YuBiao Wang <YuBiao.Wang at amd.com>
>---
> 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 9e53ff851496..4c33985542ed 100644
>--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>@@ -3825,7 +3825,8 @@ void amdgpu_device_fini_hw(struct
>amdgpu_device *adev)  {
>       dev_info(adev->dev, "amdgpu: finishing device.\n");
>       flush_delayed_work(&adev->delayed_init_work);
>-      ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
>+      if (adev->mman.initialized)
>+              ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
>       adev->shutdown = true;
>
>       /* make sure IB test finished before entering exclusive mode
>--
>2.25.1



More information about the amd-gfx mailing list