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 4/5] drm/amdgpu/gfx9.4.3: program the RLC SPM in RLC resume
Date: Mon, 16 Nov 2026 17:20:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-217426@kernel.org> (raw)
In-Reply-To: <20261116165713.1945549-4-alexander.deucher@amd.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/amdgpu: gfx_v9_4_3_xcc_rlc_resume() passes 0 instead of
  xcc_id
- [Medium] drm/amdgpu: moving update_spm_vmid() to
  gfx_v9_4_3_xcc_rlc_resume() skips VFs
--

commit 754d99a96da547c9e401d40cfbeb309d0d3aa36f
Author: Alex Deucher <alexander.deucher@amd.com>

drm/amdgpu/gfx9.4.3: program the RLC SPM in RLC resume

This commit moves the RLC SPM VMID programming from gfx_v9_4_3_rlc_init()
to gfx_v9_4_3_xcc_rlc_resume() so that the register is reprogrammed after
suspend/resume and GPU reset.

> 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..151336e6094f7 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, 0, adev->vm_manager.spm_vmid);
> +
>  	return 0;
>  }

[Severity: High]
Should update_spm_vmid() pass xcc_id instead of 0 here?

gfx_v9_4_3_rlc_resume() and gfx_v9_4_3_xcp_resume() call
gfx_v9_4_3_xcc_rlc_resume() for each XCC instance, and
gfx_v9_4_3_update_spm_vmid() uses the instance argument with
GET_INST(GC, inst) to select which XCC's regRLC_SPM_MC_CNTL register to
write.  Passing 0 programs XCC 0 on every iteration and leaves
regRLC_SPM_MC_CNTL on all other XCCs at its hardware reset default of
VMID 0.

[Severity: Medium]
Does moving update_spm_vmid() into gfx_v9_4_3_xcc_rlc_resume() skip SPM
VMID initialization on SR-IOV VFs?

Both callers of gfx_v9_4_3_xcc_rlc_resume() (gfx_v9_4_3_rlc_resume() and
gfx_v9_4_3_xcp_resume()) skip calling it when amdgpu_sriov_vf(adev) is
true:

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:gfx_v9_4_3_rlc_resume() {
	if (amdgpu_sriov_vf(adev))
		return 0;

	num_xcc = NUM_XCC(adev->gfx.xcc_mask);
	for (i = 0; i < num_xcc; i++) {
		r = gfx_v9_4_3_xcc_rlc_resume(adev, i);
    ...
}

Unlike gfx_v9_4_3_rlc_init(), which ran during sw_init on VFs as well,
gfx_v9_4_3_update_spm_vmid() is no longer reached on SR-IOV VFs, leaving
regRLC_SPM_MC_CNTL unprogrammed in SR-IOV one-VF mode despite the
amdgpu_sriov_is_pp_one_vf(adev) handling in gfx_v9_4_3_update_spm_vmid().

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

  reply	other threads:[~2026-11-16 17:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:57 [PATCH 1/5] Revert "drm/amdgpu: re-enable SPM updates in the the IB path" Alex Deucher
2026-11-16 16:57 ` [PATCH 2/5] Revert "drm/amdgpu: reemit RLC SPM register in ring reemit" Alex Deucher
2026-11-16 16:57 ` [PATCH 3/5] drm/amdgpu/gfx7,8: program the RLC SPM in RLC resume Alex Deucher
2026-11-16 16:57 ` [PATCH 4/5] drm/amdgpu/gfx9.4.3: " Alex Deucher
2026-11-16 17:20   ` sashiko-bot [this message]
2026-11-16 16:57 ` [PATCH 5/5] drm/amdgpu: bring back the ring parameter for update_spm_vmid() Alex Deucher
2026-11-16 17:26   ` sashiko-bot
2026-11-16 20:13   ` vitaly prosyak
2026-11-16 17:08 ` [PATCH 1/5] Revert "drm/amdgpu: re-enable SPM updates in the the IB path" sashiko-bot

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-217426@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