Skip to content

Commit 576b73b

Browse files
Timur Kristófgregkh
authored andcommitted
drm/amdgpu: Fix validating flush_gpu_tlb_pasid()
commit e3a6eff upstream. 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: f4db991 ("drm/amdgpu: validate the flush_gpu_tlb_pasid()") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202601190121.z9C0uml5-lkp@intel.com/ Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Signed-off-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fd78e63 commit 576b73b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,10 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
738738

739739
if (!adev->gmc.flush_pasid_uses_kiq || !ring->sched.ready) {
740740

741-
if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid)
742-
return 0;
741+
if (!adev->gmc.gmc_funcs->flush_gpu_tlb_pasid) {
742+
r = 0;
743+
goto error_unlock_reset;
744+
}
743745

744746
if (adev->gmc.flush_tlb_needs_extra_type_2)
745747
adev->gmc.gmc_funcs->flush_gpu_tlb_pasid(adev, pasid,

0 commit comments

Comments
 (0)