AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kent Russell" <kent.russell@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Disable XNACK retry on GFX12.1
Date: Mon, 16 Nov 2026 19:33:48 +0000	[thread overview]
Message-ID: <sashiko-outbox-217573@kernel.org> (raw)
In-Reply-To: <20261116191141.145348-1-kent.russell@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/amdkfd: unreachable duplicate GFX12.1 check in
  kfd_ioctl_set_xnack_mode()
--

commit 34665c5afc18630d5c2e3d3dd0b64b6b650cafc2
Author: Kent Russell <kent.russell@amd.com>

drm/amdgpu: Disable XNACK retry on GFX12.1

This commit disables XNACK retry on GFX12.1 in both amdgpu and amdkfd by
forcing noretry=1, setting RETRY_DISABLE in SH_MEM_CONFIG, and rejecting
XNACK mode enablement for GFX12.1 devices.

[ ... ]

> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 5a7f4f0cd0ce7..0728271f8c087 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;
> +			}
> +		}

[Severity: Low]
Is this loop in kfd_ioctl_set_xnack_mode() reachable?

Immediately above it, enabling XNACK checks kfd_process_xnack_mode(p,
true), which already iterates over p->pdds[] and returns false when
KFD_GC_VERSION(dev) == IP_VERSION(12, 1, 0) (or dev->kfd->noretry is set):

drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:kfd_ioctl_set_xnack_mode() {
	...
		if (p->xnack_enabled == args->xnack_enabled)
			goto out_unlock;

		if (args->xnack_enabled && !kfd_process_xnack_mode(p, true)) {
			r = -EPERM;
			goto out_unlock;
		}
	...
}

When args->xnack_enabled is 0, p->xnack_enabled is already initialized to
false on GFX12.1, so the p->xnack_enabled == args->xnack_enabled check
exits early (and if p->xnack_enabled were ever true, this unguarded loop
would reject disabling XNACK with -EPERM).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116191141.145348-1-kent.russell@amd.com?part=1

  reply	other threads:[~2026-11-16 19:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 19:11 [PATCH] drm/amdgpu: Disable XNACK retry on GFX12.1 Kent Russell
2026-11-16 19:33 ` sashiko-bot [this message]
2026-11-17 16:54 ` Mukul Joshi
2026-11-17 21:36   ` Philip Yang
  -- strict thread matches above, loose matches on Subject: below --
2026-11-16 21:55 Kent Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-217573@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=kent.russell@amd.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox