This patch fixes the GFX12 memory type to NC. Since
the Memory type can be overwritten by the previous
operations, the GFX12 MTYPE bits need to be clear
before setting to NC.

Signed-off-by: longlyao <longlong....@amd.com>
Signed-off-by: Shane Xiao <shane.x...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 3 ++-
 1 file changed, 2 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 e2c6ec3cc4f3..6246d1dc0d30 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
@@ -534,7 +534,8 @@ static void gmc_v12_0_get_vm_pte(struct amdgpu_device *adev,
 
        /* WA for HW bug */
        if (is_system || ((bo_adev != adev) && coherent))
-               *flags |= AMDGPU_PTE_MTYPE_GFX12(MTYPE_NC);
+               *flags |= (*flags & ~AMDGPU_PTE_MTYPE_GFX12_MASK) |
+                       AMDGPU_PTE_MTYPE_GFX12(MTYPE_NC);
 
 }
 
-- 
2.25.1

Reply via email to