Commit 9beb223f authored by Victor Lu's avatar Victor Lu Committed by Alex Deucher

drm/amdgpu: Fix infinite loop in gfxhub_v1_2_xcc_gart_enable (v2)

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

v2: remove tmp_mask variable

Fixes: b579ea63 ("drm/amdgpu: Modify for_each_inst macro")
Signed-off-by: default avatarVictor Lu <victorchengchi.lu@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 602816c3
...@@ -402,18 +402,15 @@ static void gfxhub_v1_2_xcc_program_invalidation(struct amdgpu_device *adev, ...@@ -402,18 +402,15 @@ static void gfxhub_v1_2_xcc_program_invalidation(struct amdgpu_device *adev,
static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev, static int gfxhub_v1_2_xcc_gart_enable(struct amdgpu_device *adev,
uint32_t xcc_mask) uint32_t xcc_mask)
{ {
uint32_t tmp_mask;
int i; int i;
tmp_mask = xcc_mask;
/* /*
* MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, because they are * MC_VM_FB_LOCATION_BASE/TOP is NULL for VF, because they are
* VF copy registers so vbios post doesn't program them, for * VF copy registers so vbios post doesn't program them, for
* SRIOV driver need to program them * SRIOV driver need to program them
*/ */
if (amdgpu_sriov_vf(adev)) { if (amdgpu_sriov_vf(adev)) {
for_each_inst(i, tmp_mask) { for_each_inst(i, xcc_mask) {
i = ffs(tmp_mask) - 1;
WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE, WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_BASE,
adev->gmc.vram_start >> 24); adev->gmc.vram_start >> 24);
WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP, WREG32_SOC15_RLC(GC, GET_INST(GC, i), regMC_VM_FB_LOCATION_TOP,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment