AMD General

> -----Original Message-----
> From: Joshi, Mukul <[email protected]>
> Sent: November 18, 2026 2:48 PM
> To: Russell, Kent <[email protected]>; [email protected]
> Cc: Yang, Philip <[email protected]>
> Subject: Re: [PATCH v4] drm/amdgpu: Disable XNACK retry on GFX12.1
>
>
> On 11/18/2026 2:29 PM, Kent Russell wrote:
> > This feature cannot be properly supported, so disable it both on the
> > amdgpu side and the amdkfd side.
> >
> > v2: Remove dead code (thanks Sashiko-bot)
> > v3: Remove unneeded extra check (thanks Mukul/Philip)
> > v4: Remove dead code (thanks Mukul)
> >
> > 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         | 17 +++++++----------
> >  .../amdkfd/kfd_device_queue_manager_v12_1.c    | 18 ++++--------------
> >  3 files changed, 18 insertions(+), 24 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 56439c9f8e17..9761c84da943 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;
> >  }
> > @@ -1567,14 +1566,12 @@ static void
> gfx_v12_1_xcc_init_compute_vmid(struct amdgpu_device *adev,
> >
> >  static void gfx_v12_1_xcc_xnack_set_chicken_bits(struct amdgpu_device
> *adev, int xcc_id)
> >  {
> > -   /* NOTE: COMPRESSION_ENABLE is used a chicken bit to enable/disable
> xcc xnack */
> > +   /* NOTE: COMPRESSION_ENABLE is used a chicken bit to enable/disable
> xcc xnack
>
> Minor nit-pick: Maybe fix up the comment here, from "is used a chicken
> bit" to "is used as a chicken bit".
Yeah I didn't make the original, but we can fix the grammar for sure. Thanks!

 Kent

> With that fixed,
>
> Reviewed-by: Mukul Joshi <[email protected]>
>
>
> > +    * Since xnack is disabled for GFX12.1, set it to 0 unconditionally
> > +    */
> >     mutex_lock(&adev->srbm_mutex);
> > -   if (!adev->gmc.noretry) {
> > -           WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id),
> > -                                 TCP_PERFCOUNTER_FILTER,
> COMPRESSION_ENABLE, 0x1);
> > -   } else
> > -           WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id),
> > -                                 TCP_PERFCOUNTER_FILTER,
> COMPRESSION_ENABLE, 0x0);
> > +   WREG32_FIELD15_PREREG(GC, GET_INST(GC, xcc_id),
> > +                         TCP_PERFCOUNTER_FILTER,
> COMPRESSION_ENABLE, 0x0);
> >     mutex_unlock(&adev->srbm_mutex);
> >  }
> >
> > 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__SH
> IFT);
> > -   } 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__SH
> IFT);
> > -   }
> > +   /* 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__SH
> IFT);
> >
> >     qpd->sh_mem_bases = compute_sh_mem_bases_64bit(pdd);
> >

Reply via email to