Commit 98f56188 authored by Yiqing Yao's avatar Yiqing Yao Committed by Alex Deucher

drm/amdgpu: flush delete wq after wait fence

[why]
lru_list not empty warning in sw fini during repeated device bind unbind.
There should be a amdgpu_fence_wait_empty() before the flush_delayed_work()
call as Christian suggested.

[how]
Move to do flush_delayed_work for ttm bo delayed delete wq after fence_driver_hw_fini.

Tested by: Yiqing Yao <yiqing.yao@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarYiqing Yao <yiqing.yao@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f333c9c6
...@@ -3972,10 +3972,6 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev) ...@@ -3972,10 +3972,6 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
{ {
dev_info(adev->dev, "amdgpu: finishing device.\n"); dev_info(adev->dev, "amdgpu: finishing device.\n");
flush_delayed_work(&adev->delayed_init_work); flush_delayed_work(&adev->delayed_init_work);
if (adev->mman.initialized) {
flush_delayed_work(&adev->mman.bdev.wq);
ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
}
adev->shutdown = true; adev->shutdown = true;
/* make sure IB test finished before entering exclusive mode /* make sure IB test finished before entering exclusive mode
...@@ -3996,6 +3992,11 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev) ...@@ -3996,6 +3992,11 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
} }
amdgpu_fence_driver_hw_fini(adev); amdgpu_fence_driver_hw_fini(adev);
if (adev->mman.initialized) {
flush_delayed_work(&adev->mman.bdev.wq);
ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
}
if (adev->pm_sysfs_en) if (adev->pm_sysfs_en)
amdgpu_pm_sysfs_fini(adev); amdgpu_pm_sysfs_fini(adev);
if (adev->ucode_sysfs_en) if (adev->ucode_sysfs_en)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment