From: Hawking Zhang <[email protected]>

Only enable page table walker to snoop CPU cache
on A + A platform

Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Le Ma <[email protected]>
Reviewed-by: Feifei Xu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c 
b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
index 4aa004ee2c4d9..6a6f1707cb53e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v12_1.c
@@ -325,10 +325,18 @@ static void gfxhub_v12_1_xcc_init_cache_regs(struct 
amdgpu_device *adev,
                WREG32_SOC15_RLC(GC, GET_INST(GC, i), regGCVM_L2_CNTL3, tmp);
 
                tmp = regGCVM_L2_CNTL4_DEFAULT;
-               tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL4,
-                                   VMC_TAP_PDE_REQUEST_PHYSICAL, 1);
-               tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL4,
-                                   VMC_TAP_PTE_REQUEST_PHYSICAL, 1);
+               if (adev->gmc.xgmi.connected_to_cpu) {
+                       tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL4,
+                                           VMC_TAP_PDE_REQUEST_PHYSICAL, 1);
+                       tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL4,
+                                           VMC_TAP_PTE_REQUEST_PHYSICAL, 1);
+               } else {
+                       tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL4,
+                                           VMC_TAP_PDE_REQUEST_PHYSICAL, 0);
+                       tmp = REG_SET_FIELD(tmp, GCVM_L2_CNTL4,
+                                           VMC_TAP_PTE_REQUEST_PHYSICAL, 0);
+               }
+
                WREG32_SOC15_RLC(GC, GET_INST(GC, i), regGCVM_L2_CNTL4, tmp);
 
                tmp = regGCVM_L2_CNTL5_DEFAULT;
-- 
2.53.0

Reply via email to