We need to disallow gfxoff if we touch GC MMIO registers.
At the moment we use MES for TLB flushes so no intended
functional change.  This just protects the MMIO access if
the MES is not available.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
index b6cd6babb035a..6e2168794d31c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
@@ -330,8 +330,14 @@ static void gmc_v12_0_flush_gpu_tlb(struct amdgpu_device 
*adev, uint32_t vmid,
                return;
        }
 
+       /* disabllow gfxoff when we invalidate */
+       if (vmhub == AMDGPU_GFXHUB(0))
+               amdgpu_gfx_off_ctrl(adev, false);
+
        gmc_v12_0_flush_vm_hub(adev, vmid, vmhub, 0);
-       return;
+
+       if (vmhub == AMDGPU_GFXHUB(0))
+               amdgpu_gfx_off_ctrl(adev, true);
 }
 
 /**
-- 
2.55.0

Reply via email to