]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu/gfx9: remove redundant repeated nested 0 check
authorEthan Carter Edwards <ethan@ethancedwards.com>
Sat, 2 Aug 2025 01:45:41 +0000 (21:45 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Aug 2025 18:17:45 +0000 (14:17 -0400)
The repeated checks on grbm_soft_reset are unnecessary. Remove them.

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 6a9cf3587cc6f0a0d00ab1c109fd599dd8aa2579..a6ff9a137a83a93cde0b0c9c9e51db66374bcbee 100644 (file)
@@ -4175,19 +4175,17 @@ static int gfx_v9_0_soft_reset(struct amdgpu_ip_block *ip_block)
                /* Disable MEC parsing/prefetching */
                gfx_v9_0_cp_compute_enable(adev, false);
 
-               if (grbm_soft_reset) {
-                       tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET);
-                       tmp |= grbm_soft_reset;
-                       dev_info(adev->dev, "GRBM_SOFT_RESET=0x%08X\n", tmp);
-                       WREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET, tmp);
-                       tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET);
-
-                       udelay(50);
-
-                       tmp &= ~grbm_soft_reset;
-                       WREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET, tmp);
-                       tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET);
-               }
+               tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET);
+               tmp |= grbm_soft_reset;
+               dev_info(adev->dev, "GRBM_SOFT_RESET=0x%08X\n", tmp);
+               WREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET, tmp);
+               tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET);
+
+               udelay(50);
+
+               tmp &= ~grbm_soft_reset;
+               WREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET, tmp);
+               tmp = RREG32_SOC15(GC, 0, mmGRBM_SOFT_RESET);
 
                /* Wait a little for things to settle down */
                udelay(50);