AMD General
[cid:506ed06b-241f-4790-892e-ee2dacd24342]<https://outlook.office.com/bookwithme/user/[email protected]?anonymous&ep=owaSlotsEmailSignature> Book time to meet with me<https://outlook.office.com/bookwithme/user/[email protected]?anonymous&ep=owaSlotsEmailSignature> ________________________________ From: amd-gfx <[email protected]> on behalf of [email protected] <[email protected]> Sent: Monday, November 16, 2026 2:12 PM To: [email protected] <[email protected]> Subject: amd-gfx Digest, Vol 126, Issue 488 ------------------------------ Message: 4 Date: Mon, 16 Nov 2026 14:10:22 -0500 From: Alex Deucher <[email protected]> To: <[email protected]> Cc: Alex Deucher <[email protected]> Subject: [PATCH 4/5 v2] drm/amdgpu/gfx9.4.3: program the RLC SPM in RLC resume Message-ID: <[email protected]> Content-Type: text/plain The register needs to be reprogrammed after a suspend and resume or a GPU reset so program it in rlc_resume rather than rlc_init. v2: pass xcc_id when calling Fixes: 7c0f7ee00c7d ("drm/amdgpu: add gc v9_4_3 rlc_funcs implementation") Signed-off-by: Alex Deucher <[email protected]> Acked-by: Vitaly Prosyak <[email protected]> --- drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c index da031caa4e9e6..7b8ff043c99ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c @@ -1395,10 +1395,6 @@ static void gfx_v9_4_3_init_rlcg_reg_access_ctrl(struct amdgpu_device *adev) static int gfx_v9_4_3_rlc_init(struct amdgpu_device *adev) { - /* init spm vmid with 0xf */ - if (adev->gfx.rlc.funcs->update_spm_vmid) - adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, adev->vm_manager.spm_vmid); - return 0; } @@ -1588,6 +1584,10 @@ static int gfx_v9_4_3_xcc_rlc_resume(struct amdgpu_device *adev, int xcc_id) gfx_v9_4_3_xcc_init_pg(adev, xcc_id); amdgpu_gfx_rlc_exit_safe_mode(adev, xcc_id); + /* init spm vmid with 0xf */ + if (adev->gfx.rlc.funcs->update_spm_vmid) + adev->gfx.rlc.funcs->update_spm_vmid(adev, xcc_id, adev->vm_manager.spm_vmid); + return 0; } -- 2.56.1 ------------------------------ Message: 5 Date: Mon, 16 Nov 2026 14:11:41 -0500 From: Kent Russell <[email protected]> To: <[email protected]> Cc: <[email protected]>, Kent Russell <[email protected]> Subject: [PATCH] drm/amdgpu: Disable XNACK retry on GFX12.1 Message-ID: <[email protected]> Content-Type: text/plain This feature cannot be properly supported, so disable it both on the amdgpu side and the amdkfd side. Signed-off-by: Kent Russell <[email protected]> --- drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 +++++++ drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c | 5 ++--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 12 ++++++++++++ .../amdkfd/kfd_device_queue_manager_v12_1.c | 18 ++++-------------- drivers/gpu/drm/amd/amdkfd/kfd_process.c | 7 +++++++ 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c index 08d3ff61edcc..d0ede277aa85 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c @@ -1151,6 +1151,13 @@ void amdgpu_gmc_noretry_set(struct amdgpu_device *adev) gmc->noretry = 1; else gmc->noretry = (amdgpu_noretry == -1) ? noretry_default : amdgpu_noretry; + + /* XNACK cannot be enabled on GFX12.1, so keep noretry=1 */ + if (gc_ver == IP_VERSION(12, 1, 0)) { + if (amdgpu_noretry == 0) + dev_warn(adev->dev, "Unable to set noretry = 0 on GFX12.1. Keeping noretry = 1"); + gmc->noretry = 1; + } } void amdgpu_gmc_set_vm_fault_masks(struct amdgpu_device *adev, int hub_type, diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c index 1f57d0fa2c04..034cc3fd07f3 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c @@ -1518,9 +1518,8 @@ static u32 gfx_v12_1_get_sh_mem_config(struct amdgpu_device *adev) { u32 sh_mem_config = DEFAULT_SH_MEM_CONFIG; - /* GC 12.1.0 A0 requires RETRY_DISABLE in SH_MEM_CONFIG. */ - if (SOC_V1_0_DIE_REV_XCD(adev->rev_id) == 0) - sh_mem_config |= 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT; + /* XNACK cannot be enabled for GFX12.1 */ + sh_mem_config |= 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT; return sh_mem_config; } diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 3d2136adb62b..3b62b9e5ecda 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -1766,6 +1766,8 @@ static int kfd_ioctl_set_xnack_mode(struct file *filep, mutex_lock(&p->mutex); if (args->xnack_enabled >= 0) { + int i; + if (!list_empty(&p->pqm.queues)) { pr_debug("Process has user queues running\n"); r = -EBUSY; @@ -1780,6 +1782,16 @@ static int kfd_ioctl_set_xnack_mode(struct file *filep, goto out_unlock; } + /* XNACK cannot be enabled for gfx12.1 */ + for (i = 0; i < p->n_pdds; i++) { + struct kfd_node *dev = p->pdds[i]->dev; + + if (KFD_GC_VERSION(dev) == IP_VERSION(12, 1, 0)) { + r = -EPERM; + goto out_unlock; + } + } + r = svm_range_switch_xnack_reserve_mem(p, args->xnack_enabled); } else { args->xnack_enabled = p->xnack_enabled; diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v12_1.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v12_1.c index 525989371378..63ba13a60b98 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v12_1.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_v12_1.c @@ -54,7 +54,6 @@ static int update_qpd_v12_1(struct device_queue_manager *dqm, struct kfd_process_device *pdd; struct amdgpu_device *adev = dqm->dev->adev; struct amdgpu_vmhub *hub = &adev->vmhub[AMDGPU_GFXHUB(0)]; - bool xnack_enabled; pdd = qpd_to_pdd(qpd); qpd->vm_cntx_cntl = hub->vm_cntx_cntl; @@ -72,19 +71,10 @@ static int update_qpd_v12_1(struct device_queue_manager *dqm, qpd->sh_mem_ape1_base = 0; } - xnack_enabled = KFD_SUPPORT_XNACK_PER_PROCESS(dqm->dev) ? - pdd->process->xnack_enabled : - !pdd->dev->kfd->noretry; - - if (!xnack_enabled) { - qpd->sh_mem_config |= 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT; - qpd->vm_cntx_cntl &= - ~(1 << GCVM_CONTEXT0_CNTL__RETRY_PERMISSION_OR_INVALID_PAGE_FAULT__SHIFT); - } else { - qpd->sh_mem_config &= ~(1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT); - qpd->vm_cntx_cntl |= - (1 << GCVM_CONTEXT0_CNTL__RETRY_PERMISSION_OR_INVALID_PAGE_FAULT__SHIFT); - } + /* XNACK cannot be enabled for gfx12.1 */ + qpd->sh_mem_config |= 1 << SH_MEM_CONFIG__RETRY_DISABLE__SHIFT; + qpd->vm_cntx_cntl &= + ~(1 << GCVM_CONTEXT0_CNTL__RETRY_PERMISSION_OR_INVALID_PAGE_FAULT__SHIFT); qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 546721b4d59a..059e22cd7f1a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -1670,6 +1670,13 @@ bool kfd_process_xnack_mode(struct kfd_process *p, bool supported) KFD_GC_VERSION(dev) < IP_VERSION(12, 1, 0)) return false; + /* XNACK cannot be enabled on GFX12.1 . While dev->kfd->noretry + * should propagate this requirement, adding it explicitly here + * will help cover any possible future reworks + */ + if (KFD_GC_VERSION(dev) == IP_VERSION(12, 1, 0)) + return false; + if (dev->kfd->noretry) return false; } -- 2.43.0 ------------------------------ Subject: Digest Footer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx ------------------------------ End of amd-gfx Digest, Vol 126, Issue 488 *****************************************
