AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Frank Min" <Frank.Min@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 7/9] drm/amdgpu: remove the unused ring parameter in update_spm_vmid() for gfx13
Date: Fri, 04 Dec 2026 16:11:06 +0000	[thread overview]
Message-ID: <sashiko-outbox-250164@kernel.org> (raw)
In-Reply-To: <20261204142408.988734-7-Frank.Min@amd.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/amdgpu: update_spm_vmid() signature mismatch breaks
  gfx_v13_0.c build
- [High] drm/amdgpu: dropping ring path in gfx_v13_0_update_spm_vmid()
  breaks IB SPM
--

commit a118ecae2dc4a26b43bad4e4bf47f778ad08d52a
Author: Frank Min <Frank.Min@amd.com>

drm/amdgpu: remove the unused ring parameter in update_spm_vmid() for gfx13

This patch removes the ring parameter and its in-band ring write path from
gfx_v13_0_update_spm_vmid(), and updates its call site in
gfx_v13_0_rlc_resume() accordingly.

> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
> index f0ac919a43480..9ef249b95f916 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v13_0.c
> @@ -2134,7 +2134,7 @@ static int gfx_v13_0_rlc_resume(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, NULL, adev->vm_manager.spm_vmid);
> +		adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, adev->vm_manager.spm_vmid);

[Severity: High]
Does this break the build due to a signature mismatch with struct
amdgpu_rlc_funcs?

struct amdgpu_rlc_funcs in drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.h still
declares update_spm_vmid with four parameters, including struct amdgpu_ring
*ring, as restored by e9ebb72a64b6 ("drm/amdgpu: bring back the ring
parameter for update_spm_vmid()").

Calling update_spm_vmid() with three arguments here fails compilation, as
does assigning the three-parameter gfx_v13_0_update_spm_vmid() to
gfx_v13_0_rlc_funcs.update_spm_vmid.

[ ... ]

> @@ -3963,22 +3963,12 @@ static void gfx_v13_0_update_perf_clk(struct amdgpu_device *adev,
>  
>  static void gfx_v13_0_update_spm_vmid(struct amdgpu_device *adev,
>  				      int xcc_id,
> -				      struct amdgpu_ring *ring,
>  				      unsigned vmid)
>  {
>  	u32 reg, data;
>  
>  	reg = SOC15_REG_OFFSET(GC, 0, regRLC_SPM_MC_CNTL);
>  
> -	if (ring) {
> -		if ((ring->funcs->type == AMDGPU_RING_TYPE_GFX) ||
> -		    (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE)) {
> -			data = (vmid & RLC_SPM_MC_CNTL__RLC_SPM_VMID_MASK) << RLC_SPM_MC_CNTL__RLC_SPM_VMID__SHIFT;
> -			amdgpu_ring_emit_wreg(ring, reg, data);
> -		}
> -		return;
> -	}
> -
>  	amdgpu_gfx_off_ctrl(adev, false);
>  	if (amdgpu_sriov_is_pp_one_vf(adev))
>  		data = RREG32_NO_KIQ(reg);

[Severity: High]
Is the ring parameter actually unused, and does deleting this branch break
in-band SPM updates during IB submission?

amdgpu_ib_schedule() still passes a non-NULL ring to update_spm_vmid() on
every gfx and compute IB submission.  Both gfx_v13_0_ring_funcs_gfx and
gfx_v13_0_ring_funcs_compute also reserve 5 dwords in emit_frame_size for
this write.

Even if the signature were reconciled, dropping the if (ring) path loses
the ring-based regRLC_SPM_MC_CNTL update across gfxoff cycles and forces
every IB submission through amdgpu_gfx_off_ctrl() (acquiring
adev->gfx.gfx_off_mutex) and unlocked CPU register read-modify-writes.

Should this patch be dropped instead so gfx13 keeps the ring path?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204142408.988734-1-Frank.Min@amd.com?part=7

  parent reply	other threads:[~2026-12-04 16:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 14:24 [PATCH 1/9] drm/amdgpu: skip vm inv for kiq ring Frank Min
2026-12-04 14:24 ` [PATCH 2/9] drm/amdgpu: disable gfx 13 pipe 1 ring Frank Min
2026-12-04 14:55   ` sashiko-bot
2026-12-04 16:05   ` Alex Deucher
2026-12-04 14:24 ` [PATCH 3/9] drm/amdgpu: update table info retrieval from discovery binary Frank Min
2026-12-04 15:14   ` sashiko-bot
2026-12-04 16:19   ` Alex Deucher
2026-12-04 14:24 ` [PATCH 4/9] drm/amdgpu: add lsdma v8 fw query interface Frank Min
2026-12-04 15:25   ` sashiko-bot
2026-12-04 16:21   ` Alex Deucher
2026-12-04 14:24 ` [PATCH 5/9] drm/amdgpu: add lsdma v8 fw loading support Frank Min
2026-12-04 15:47   ` sashiko-bot
2026-12-04 14:24 ` [PATCH 6/9] drm/amdgpu: Fix system aperture size for gfx13 Frank Min
2026-12-04 16:01   ` sashiko-bot
2026-12-04 14:24 ` [PATCH 7/9] drm/amdgpu: remove the unused ring parameter in update_spm_vmid() " Frank Min
2026-12-04 16:03   ` Alex Deucher
2026-12-04 16:11   ` sashiko-bot [this message]
2026-12-04 14:24 ` [PATCH 8/9] drm/amdgpu: enable uni-mes " Frank Min
2026-12-04 16:41   ` sashiko-bot
2026-12-04 17:24   ` Alex Deucher
2026-12-04 14:24 ` [PATCH 9/9] drm/amdgpu: fix mutex unlock position for ucode loading Frank Min
2026-12-04 16:12   ` Alex Deucher
2026-12-04 16:52   ` sashiko-bot
2026-12-04 14:41 ` [PATCH 1/9] drm/amdgpu: skip vm inv for kiq ring sashiko-bot
2026-12-04 16:16 ` Alex Deucher

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-250164@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Min@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