From ba91492f350753f9bca7a9f41745abf7b3126e47 Mon Sep 17 00:00:00 2001 From: Victor Skvortsov Date: Thu, 3 Feb 2022 16:12:57 +0000 Subject: [PATCH] drm/amdgpu: Fix wait for RLCG command completion if (!(tmp & flag)) condition will always evaluate to true when the flag is 0x0. Instead check that address bits are cleared to determine whether the command is complete. Signed-off-by: Victor Skvortsov (cherry picked from commit 4d3a7668c52401807316c754e575452a8d6573a5) Change-Id: I979ff7334db5c917de7b34feff98699f65ec625a --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 0a6c8fd0d5544..2c6551dbfb565 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -789,7 +789,8 @@ static u32 gfx_v9_0_rlcg_rw(struct amdgpu_device *adev, u32 offset, u32 v, uint3 for (i = 0; i < retries; i++) { tmp = readl(scratch_reg1); - if (!(tmp & flag)) + //Check the address bits + if (!(tmp & 0xFFFFF)) break; udelay(10);