]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
amdkfd: MTYPE_UC for ext-coherent system memory
authorDavid Yat Sin <David.YatSin@amd.com>
Thu, 19 Jun 2025 17:51:13 +0000 (17:51 +0000)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 30 Jun 2025 17:51:46 +0000 (13:51 -0400)
Set memory mtype to UC host memory when ext-coherent
flag is set and memory is registered as a SVM allocation.

Reviewed-by: Amber Lin <Amber.Lin@amd.com>
Signed-off-by: David Yat Sin <David.YatSin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 5d14fdab4778c29cfd39e62c3ce84d232b4a7d8c)

drivers/gpu/drm/amd/amdkfd/kfd_svm.c

index 865dca2547de5b6557925a2d2411dff8a3d65898..7763e4742080b9e1c703fc2bccfea0dafd340b67 100644 (file)
@@ -1278,7 +1278,7 @@ svm_range_get_pte_flags(struct kfd_node *node,
                                mapping_flags |= ext_coherent ? AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
                /* system memory accessed by the dGPU */
                } else {
-                       if (gc_ip_version < IP_VERSION(9, 5, 0))
+                       if (gc_ip_version < IP_VERSION(9, 5, 0) || ext_coherent)
                                mapping_flags |= AMDGPU_VM_MTYPE_UC;
                        else
                                mapping_flags |= AMDGPU_VM_MTYPE_NC;