From: "Christian König" <christian.koenig@amd.com>
To: YuBiao Wang <YuBiao.Wang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>,
Jack Xiao <Jack.Xiao@amd.com>, Feifei Xu <Feifei.Xu@amd.com>,
horace.chen@amd.com, Kevin Wang <Kevin1.Wang@amd.com>,
Tuikov Luben <Luben.Tuikov@amd.com>,
Deucher Alexander <Alexander.Deucher@amd.com>,
Evan Quan <Evan.Quan@amd.com>,
Jingwen Chen <Jingwen.Chen2@amd.com>, Monk Liu <Monk.Liu@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.com>
Subject: Re: [PATCH] drm/amd/amdgpu: Avoid writing GMC registers under sriov in gmc9
Date: Thu, 4 Nov 2021 08:49:09 +0100 [thread overview]
Message-ID: <50daadfb-cb9a-b4a1-3729-0dd241778e1c@amd.com> (raw)
In-Reply-To: <20211104025506.533625-1-YuBiao.Wang@amd.com>
Am 04.11.21 um 03:55 schrieb YuBiao Wang:
> [Why]
> For Vega10, disabling gart of gfxhub and mmhub could mess up KIQ and PSP
> under sriov mode, and lead to DMAR on host side.
>
> [How]
> Skip writing GMC registers under sriov.
>
> Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 26 +++++++++++++-----------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> index bda1542ef1dd..f9a7349eb601 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> @@ -348,18 +348,20 @@ static void gfxhub_v1_0_gart_disable(struct amdgpu_device *adev)
> WREG32_SOC15_OFFSET(GC, 0, mmVM_CONTEXT0_CNTL,
> i * hub->ctx_distance, 0);
>
> - /* Setup TLB control */
> - tmp = RREG32_SOC15(GC, 0, mmMC_VM_MX_L1_TLB_CNTL);
> - tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 0);
> - tmp = REG_SET_FIELD(tmp,
> - MC_VM_MX_L1_TLB_CNTL,
> - ENABLE_ADVANCED_DRIVER_MODEL,
> - 0);
> - WREG32_SOC15_RLC(GC, 0, mmMC_VM_MX_L1_TLB_CNTL, tmp);
> -
> - /* Setup L2 cache */
> - WREG32_FIELD15(GC, 0, VM_L2_CNTL, ENABLE_L2_CACHE, 0);
> - WREG32_SOC15(GC, 0, mmVM_L2_CNTL3, 0);
> + if (!amdgpu_sriov_vf(adev)) {
Maybe make that an "if (amdgpu_sriov_vf(adev)) return", but in general
feel free to add an Acked-by: Christian König <christian.koenig@amd.com>
to the patch.
Additional to that the patch should probably be send to the public
mailing list instead.
Regards,
Christian.
> + /* Setup TLB control */
> + tmp = RREG32_SOC15(GC, 0, mmMC_VM_MX_L1_TLB_CNTL);
> + tmp = REG_SET_FIELD(tmp, MC_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, 0);
> + tmp = REG_SET_FIELD(tmp,
> + MC_VM_MX_L1_TLB_CNTL,
> + ENABLE_ADVANCED_DRIVER_MODEL,
> + 0);
> + WREG32_SOC15_RLC(GC, 0, mmMC_VM_MX_L1_TLB_CNTL, tmp);
> +
> + /* Setup L2 cache */
> + WREG32_FIELD15(GC, 0, VM_L2_CNTL, ENABLE_L2_CACHE, 0);
> + WREG32_SOC15(GC, 0, mmVM_L2_CNTL3, 0);
> + }
> }
>
> /**
next prev parent reply other threads:[~2021-11-04 7:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 2:55 [PATCH] drm/amd/amdgpu: Avoid writing GMC registers under sriov in gmc9 YuBiao Wang
2021-11-04 7:49 ` Christian König [this message]
2021-11-04 7:58 ` Christian König
-- strict thread matches above, loose matches on Subject: below --
2021-11-02 10:25 YuBiao Wang
2021-11-02 11:10 ` Christian König
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=50daadfb-cb9a-b4a1-3729-0dd241778e1c@amd.com \
--to=christian.koenig@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Andrey.Grodzovsky@amd.com \
--cc=Evan.Quan@amd.com \
--cc=Feifei.Xu@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Jack.Xiao@amd.com \
--cc=Jingwen.Chen2@amd.com \
--cc=Kevin1.Wang@amd.com \
--cc=Luben.Tuikov@amd.com \
--cc=Monk.Liu@amd.com \
--cc=YuBiao.Wang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--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