drm/amd: force remote MTYPE_NC on GFX12.1 mtype_local=0

Work around this in both the amdgpu GMC and KFD SVM paths by explicitly
selecting MTYPE_NC for remote memory when amdgpu_mtype_local is 0. Remove
this once rev_id-based AID detection is reliable.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Alex Sierra 2026-07-07 13:34:47 -05:00 committed by Alex Deucher
parent 8760df21b3
commit a8b1c724d2
2 changed files with 4 additions and 2 deletions

View File

@ -617,8 +617,9 @@ static void gmc_v12_1_get_coherence_flags(struct amdgpu_device *adev,
mtype_local = is_aid_a1 ? MTYPE_RW : MTYPE_NC;
mtype_remote = is_aid_a1 ? MTYPE_NC : MTYPE_UC;
if (amdgpu_mtype_local == 0) {
DRM_INFO_ONCE("Using MTYPE_RW for local memory\n");
DRM_INFO_ONCE("Using MTYPE_RW for local memory and MTYPE_NC for remote memory\n");
mtype_local = MTYPE_RW;
mtype_remote = MTYPE_NC;
} else if (amdgpu_mtype_local == 1) {
DRM_INFO_ONCE("Using MTYPE_NC for local memory\n");
mtype_local = MTYPE_NC;

View File

@ -1348,7 +1348,8 @@ svm_range_get_pte_flags(struct kfd_node *node, struct amdgpu_vm *vm,
mtype_local = amdgpu_mtype_local == 0 ? AMDGPU_VM_MTYPE_RW :
amdgpu_mtype_local == 1 ? AMDGPU_VM_MTYPE_NC :
is_aid_a1 ? AMDGPU_VM_MTYPE_RW : AMDGPU_VM_MTYPE_NC;
mtype_remote = is_aid_a1 ? AMDGPU_VM_MTYPE_NC : AMDGPU_VM_MTYPE_UC;
mtype_remote = amdgpu_mtype_local == 0 ? AMDGPU_VM_MTYPE_NC :
is_aid_a1 ? AMDGPU_VM_MTYPE_NC : AMDGPU_VM_MTYPE_UC;
snoop = true;
if (is_local) /* local HBM */ {