From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Yiqing Yao <YiQing.Yao@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, christian.koenig@amd.com,
haijun.chang@amd.com, horace.chen@amd.com
Subject: Re: [PATCH] drm/amdgpu: use local xcc write to flush tlb
Date: Mon, 3 Jun 2024 20:09:03 +0200 [thread overview]
Message-ID: <29d354ec-2cbf-4249-8769-031e93183cb5@gmail.com> (raw)
In-Reply-To: <20240603114607.4143848-1-YiQing.Yao@amd.com>
Am 03.06.24 um 13:46 schrieb Yiqing Yao:
> When flushing gpu tlb using kiq from gfxhub, kiq ring is always
> local as xcc instance is selected for it. Thus using lower 18 bits
> to access mmregs inside local xcc instead of full address used
> when accessing regs outside of local xcc.
>
> Remove redundent code.
>
> Signed-off-by: Yiqing Yao <YiQing.Yao@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 350f6b6676f1..864fea31c354 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -853,8 +853,10 @@ static void gmc_v9_0_flush_gpu_tlb(struct amdgpu_device *adev, uint32_t vmid,
> */
> if (adev->gfx.kiq[inst].ring.sched.ready &&
> (amdgpu_sriov_runtime(adev) || !amdgpu_sriov_vf(adev))) {
> - uint32_t req = hub->vm_inv_eng0_req + hub->eng_distance * eng;
> - uint32_t ack = hub->vm_inv_eng0_ack + hub->eng_distance * eng;
> +
> + /* Select lower 18 bits to write in local xcc */
> + if (vmhub < AMDGPU_MMHUB0(0))
> + req = req & 0x3ffff;
A bit more explanation would be good here, e.g. what you have in the
commit message.
Apart from that why do we need that in the first place? Isn't the KIQ
able to access the register anyway?
Regards,
Christian.
>
> amdgpu_gmc_fw_reg_write_reg_wait(adev, req, ack, inv_req,
> 1 << vmid, inst);
prev parent reply other threads:[~2024-06-03 18:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 11:46 [PATCH] drm/amdgpu: use local xcc write to flush tlb Yiqing Yao
2024-06-03 18:09 ` Christian König [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=29d354ec-2cbf-4249-8769-031e93183cb5@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=YiQing.Yao@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=haijun.chang@amd.com \
--cc=horace.chen@amd.com \
/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