drm/amdgpu: Fix validating flush_gpu_tlb_pasid()
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix validating flush_gpu_tlb_pasid()
From: Timur Kristóf <[email protected]>
When a function holds a lock and we return without unlocking it, it deadlocks the kernel. We should always unlock before returning.
This commit fixes suspend/resume on SI. Tested on two Tahiti GPUs: FirePro W9000 and R9 280X.
Fixes bc2dea30038a ("drm/amdgpu: validate the flush_gpu_tlb_pasid()")
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Timur Kristóf <[email protected]>
Signed-off-by Prike Liang <[email protected]>
Reviewed-by Prike Liang <[email protected]>
Reviewed-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +4 -2
@@ -781,8 +781,10 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) { -if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid) -return 0 ; +if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid) { + r =0 ; + goto error_unlock_reset; + }if (adev->gmc.flush_tlb_needs_extra_type_2) adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,
Signature · 1 line
2.34.1