AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Deucher" <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/amdgpu/gfx11: don't enable gfx on pipe1 with tmz
Date: Thu, 19 Nov 2026 19:47:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-223970@kernel.org> (raw)
In-Reply-To: <20261119193620.217718-2-alexander.deucher@amd.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] drm/amdgpu/gfx11: NULL pointer dereference in
  amdgpu_ring_init() [1]
--

commit 0a934348cc9c64c8c23b8255a5b64447ad24179d
Author: Alex Deucher <alexander.deucher@amd.com>

drm/amdgpu/gfx11: don't enable gfx on pipe1 with tmz

This commit limits GFX11 devices to a single GFX pipe and ring when TMZ
is enabled, as the firmware does not support TMZ on pipe 1.

> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 570f0f3a2ea5e..16b211174c8dd 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -1690,7 +1690,8 @@ static int gfx_v11_0_sw_init(struct amdgpu_ip_block *ip_block)
>  	case IP_VERSION(11, 7, 0):
>  	case IP_VERSION(11, 7, 1):
>  		adev->gfx.me.num_me = 1;
> -		if (adev->gfx.rs64_enable)
> +		if (adev->gfx.rs64_enable ||
> +		    adev->gmc.tmz_enabled)
>  			adev->gfx.me.num_pipe_per_me = 1;
>  		else
>  			adev->gfx.me.num_pipe_per_me = 2;

[Severity: High]
This problem wasn't introduced by this patch, but should this condition
also check adev->gfx.disable_kq [1]?

When amdgpu.user_queue=2 sets adev->gfx.disable_kq, gfx_v11_0_early_init()
sets adev->gfx.num_gfx_rings = 1, so gfx_v11_0_set_ring_funcs() only
populates adev->gfx.gfx_ring[0].funcs and leaves gfx_ring[1].funcs NULL.

If adev->gfx.me.num_pipe_per_me is set to 2 here, gfx_v11_0_me_init() ->
amdgpu_gfx_graphics_queue_acquire() enables queues on both pipes and
overwrites adev->gfx.num_gfx_rings to 2.  gfx_v11_0_sw_init() then calls
gfx_v11_0_gfx_ring_init() for gfx_ring[1], causing amdgpu_ring_init() to
dereference the NULL ring->funcs pointer.

[1] https://sashiko.dev/#/bug/linux-cb8251e2-db73-484e-81c4-7d48aaa6e13f

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119193620.217718-1-alexander.deucher@amd.com?part=2

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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:36 [PATCH 1/2] drm/amdgpu: move tmz init into early_init() Alex Deucher
2026-11-19 19:36 ` [PATCH 2/2] drm/amdgpu/gfx11: don't enable gfx on pipe1 with tmz Alex Deucher
2026-11-19 19:47   ` sashiko-bot [this message]

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-223970@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --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