Skip to contentSkip to conversation

drm/amdgpu: Fix validating flush_gpu_tlb_pasid()

PATCH New Prike Liang 1 participant 1 message Jan 19

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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()")
---
 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
index 0e67fa4338ff..d9ff68a43178 100644
@@ -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