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@amd.com>
Reviewed-by: Emily.Deng <Emily.Deng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
YuBiao Wang 2021-08-05 10:32:40 +08:00 committed by Alex Deucher
parent 124e8b1990
commit e78b3197db

View File

@ -3826,7 +3826,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