Commit e3a6eff9 authored by Timur Kristóf's avatar Timur Kristóf Committed by Alex Deucher
Browse files

drm/amdgpu: Fix validating flush_gpu_tlb_pasid()



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: f4db9913 ("drm/amdgpu: validate the flush_gpu_tlb_pasid()")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202601190121.z9C0uml5-lkp@intel.com/


Signed-off-by: default avatarTimur Kristóf <timur.kristof@gmail.com>
Signed-off-by: default avatarPrike Liang <Prike.Liang@amd.com>
Reviewed-by: default avatarPrike Liang <Prike.Liang@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent afaf4250
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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,