[PATCH] drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable

Zhou, Bob Bob.Zhou at amd.com
Wed Jul 19 09:12:44 UTC 2023


[AMD Official Use Only - General]

The variable tmp_mask also could be removed.

Regards,
Bob

-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Victor Lu
Sent: Wednesday, July 19, 2023 3:02 AM
To: amd-gfx at lists.freedesktop.org
Cc: Lazar, Lijo <Lijo.Lazar at amd.com>; Skvortsov, Victor <Victor.Skvortsov at amd.com>; Lu, Victor Cheng Chi (Victor) <VictorChengChi.Lu at amd.com>
Subject: [PATCH] drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable

An instance of for_each_inst() was not changed to match its new behaviour and is causing a loop.

Fixes: 50c1d81d6365 ("drm/amdgpu: Modify for_each_inst macro")
Signed-off-by: Victor Lu <victorchengchi.lu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
index 47f95ec218a3..b74df0e9fb08 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c
@@ -413,7 +413,6 @@ static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev,
         */
        if (amdgpu_sriov_vf(adev)) {
                for_each_inst(i, tmp_mask) {
-                       i = ffs(tmp_mask) - 1;
                        WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE,
                                     adev->gmc.vram_start >> 24);
                        WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP,
--
2.34.1



More information about the amd-gfx mailing list