From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/7] drm/amdgpu/gmc9: don't touch gfxhub registers during S0ix
Date: Thu, 15 Dec 2022 08:45:22 +0100 [thread overview]
Message-ID: <83ccb403-5c69-e191-41d9-0e5870baf40d@gmail.com> (raw)
In-Reply-To: <20221214221654.1625194-2-alexander.deucher@amd.com>
Am 14.12.22 um 23:16 schrieb Alex Deucher:
> gfxhub registers are part of gfx IP and should not need to be
> changed. Doing so without disabling gfxoff can hang the gfx IP.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 26 ++++++++++++++++++++------
> 1 file changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 08d6cf79fb15..5f07c85bf729 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -484,6 +484,9 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev,
> for (i = 0; i < 16; i++) {
> reg = hub->vm_context0_cntl + i;
>
> + if (adev->in_s0ix && (j == AMDGPU_GFXHUB_0))
> + continue;
> +
I'm not sure we can do this because the higher layer will then have an
incorrect impression of the interrupt state here.
Christian.
> if (j == AMDGPU_GFXHUB_0)
> tmp = RREG32_SOC15_IP(GC, reg);
> else
> @@ -504,6 +507,9 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev,
> for (i = 0; i < 16; i++) {
> reg = hub->vm_context0_cntl + i;
>
> + if (adev->in_s0ix && (j == AMDGPU_GFXHUB_0))
> + continue;
> +
> if (j == AMDGPU_GFXHUB_0)
> tmp = RREG32_SOC15_IP(GC, reg);
> else
> @@ -1862,9 +1868,12 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev)
> }
>
> amdgpu_gtt_mgr_recover(&adev->mman.gtt_mgr);
> - r = adev->gfxhub.funcs->gart_enable(adev);
> - if (r)
> - return r;
> +
> + if (!adev->in_s0ix) {
> + r = adev->gfxhub.funcs->gart_enable(adev);
> + if (r)
> + return r;
> + }
>
> r = adev->mmhub.funcs->gart_enable(adev);
> if (r)
> @@ -1911,11 +1920,15 @@ static int gmc_v9_0_hw_init(void *handle)
> value = true;
>
> if (!amdgpu_sriov_vf(adev)) {
> - adev->gfxhub.funcs->set_fault_enable_default(adev, value);
> + if (!adev->in_s0ix)
> + adev->gfxhub.funcs->set_fault_enable_default(adev, value);
> adev->mmhub.funcs->set_fault_enable_default(adev, value);
> }
> - for (i = 0; i < adev->num_vmhubs; ++i)
> + for (i = 0; i < adev->num_vmhubs; ++i) {
> + if (adev->in_s0ix && (i == AMDGPU_GFXHUB_0))
> + continue;
> gmc_v9_0_flush_gpu_tlb(adev, 0, i, 0);
> + }
>
> if (adev->umc.funcs && adev->umc.funcs->init_registers)
> adev->umc.funcs->init_registers(adev);
> @@ -1939,7 +1952,8 @@ static int gmc_v9_0_hw_init(void *handle)
> */
> static void gmc_v9_0_gart_disable(struct amdgpu_device *adev)
> {
> - adev->gfxhub.funcs->gart_disable(adev);
> + if (!adev->in_s0ix)
> + adev->gfxhub.funcs->gart_disable(adev);
> adev->mmhub.funcs->gart_disable(adev);
> }
>
next prev parent reply other threads:[~2022-12-15 7:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 22:16 [PATCH 0/7] Improvde S0ix stability Alex Deucher
2022-12-14 22:16 ` [PATCH 1/7] drm/amdgpu/gmc9: don't touch gfxhub registers during S0ix Alex Deucher
2022-12-15 7:45 ` Christian König [this message]
2022-12-15 22:08 ` Alex Deucher
2022-12-14 22:16 ` [PATCH 2/7] drm/amdgpu/gmc10: " Alex Deucher
2022-12-14 22:16 ` [PATCH 3/7] drm/amdgpu/gmc11: " Alex Deucher
2022-12-14 22:16 ` [PATCH 4/7] drm/amdgpu: don't mess with SDMA clock or powergating in S0ix Alex Deucher
2022-12-14 22:16 ` [PATCH 5/7] drm/amdgpu: for S0ix, skip SMDA 5.x+ suspend/resume Alex Deucher
2022-12-15 15:04 ` Bhardwaj, Rajneesh
2022-12-15 15:58 ` Alex Deucher
2022-12-14 22:16 ` [PATCH 6/7] Revert "drm/amdgpu: disallow gfxoff until GC IP blocks complete s2idle resume" Alex Deucher
2022-12-14 22:16 ` [PATCH 7/7] Revert "drm/amdgpu: force exit gfxoff on sdma resume for rmb s0ix" Alex Deucher
-- strict thread matches above, loose matches on Subject: below --
2022-12-15 22:10 [PATCH 0/7 v2] Improve S0ix stability Alex Deucher
2022-12-15 22:10 ` [PATCH 1/7] drm/amdgpu/gmc9: don't touch gfxhub registers during S0ix 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=83ccb403-5c69-e191-41d9-0e5870baf40d@gmail.com \
--to=ckoenig.leichtzumerken@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/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