Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: fix eviction fence and userq manager shutdown

That is a really complicated dance and wasn't implemented fully correct.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
99f30a06 2cd7284b

+18 -3
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 2953 2953 2954 2954 if (fpriv && drm_dev_enter(dev, &idx)) { 2955 2955 amdgpu_evf_mgr_shutdown(&fpriv->evf_mgr); 2956 + amdgpu_userq_mgr_cancel_resume(&fpriv->userq_mgr); 2957 + amdgpu_evf_mgr_flush_suspend(&fpriv->evf_mgr); 2956 2958 amdgpu_userq_mgr_fini(&fpriv->userq_mgr); 2957 2959 amdgpu_evf_mgr_fini(&fpriv->evf_mgr); 2958 2960 drm_dev_exit(idx);
+9 -3
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
··· 143 143 void amdgpu_evf_mgr_shutdown(struct amdgpu_eviction_fence_mgr *evf_mgr) 144 144 { 145 145 evf_mgr->shutdown = true; 146 + /* Make sure that the shutdown is visible to the suspend work */ 147 + flush_work(&evf_mgr->suspend_work); 148 + } 149 + 150 + void amdgpu_evf_mgr_flush_suspend(struct amdgpu_eviction_fence_mgr *evf_mgr) 151 + { 152 + dma_fence_wait(rcu_dereference_protected(evf_mgr->ev_fence, true), 153 + false); 154 + /* Make sure that we are done with the last suspend work */ 146 155 flush_work(&evf_mgr->suspend_work); 147 156 } 148 157 149 158 void amdgpu_evf_mgr_fini(struct amdgpu_eviction_fence_mgr *evf_mgr) 150 159 { 151 - dma_fence_wait(rcu_dereference_protected(evf_mgr->ev_fence, true), 152 - false); 153 - flush_work(&evf_mgr->suspend_work); 154 160 dma_fence_put(evf_mgr->ev_fence); 155 161 }
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.h
··· 66 66 struct amdgpu_bo *bo); 67 67 void amdgpu_evf_mgr_init(struct amdgpu_eviction_fence_mgr *evf_mgr); 68 68 void amdgpu_evf_mgr_shutdown(struct amdgpu_eviction_fence_mgr *evf_mgr); 69 + void amdgpu_evf_mgr_flush_suspend(struct amdgpu_eviction_fence_mgr *evf_mgr); 69 70 void amdgpu_evf_mgr_fini(struct amdgpu_eviction_fence_mgr *evf_mgr); 70 71 71 72 #endif
+5
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
··· 1345 1345 return 0; 1346 1346 } 1347 1347 1348 + void amdgpu_userq_mgr_cancel_resume(struct amdgpu_userq_mgr *userq_mgr) 1349 + { 1350 + cancel_delayed_work_sync(&userq_mgr->resume_work); 1351 + } 1352 + 1348 1353 void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr) 1349 1354 { 1350 1355 struct amdgpu_usermode_queue *queue;
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h
··· 123 123 int amdgpu_userq_mgr_init(struct amdgpu_userq_mgr *userq_mgr, struct drm_file *file_priv, 124 124 struct amdgpu_device *adev); 125 125 126 + void amdgpu_userq_mgr_cancel_resume(struct amdgpu_userq_mgr *userq_mgr); 126 127 void amdgpu_userq_mgr_fini(struct amdgpu_userq_mgr *userq_mgr); 127 128 128 129 int amdgpu_userq_create_object(struct amdgpu_userq_mgr *uq_mgr,