Skip to contentSkip to conversation

drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable

PATCH Superseded Victor Lu 2 participants 2 messages Jul 18, 2023 – Jul 19, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Victor Lu

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +0 -1
index 47f95ec218a3..b74df0e9fb08 100644
@@ -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,
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - General]

The variable tmp_mask also could be removed.

Regards,
Bob

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Victor Lu
Sent: Wednesday, July 19, 2023 3:02 AM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Skvortsov, Victor <[email protected]>; Lu, Victor Cheng Chi (Victor) <[email protected]>
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")
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c +0 -1
index 47f95ec218a3..b74df0e9fb08 100644
@@ -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