From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Yifan Zhang <yifan1.zhang@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com
Subject: Re: [PATCH] drm/amdgpu: Put GPU CG/PG ungate in device_fini_hw and device_halt
Date: Mon, 2 Feb 2026 12:41:57 +0530 [thread overview]
Message-ID: <7b087ad3-e18d-407f-8e97-5ee35e564fd8@amd.com> (raw)
In-Reply-To: <20260202063151.2363659-1-yifan1.zhang@amd.com>
On 02-Feb-26 12:01 PM, Yifan Zhang wrote:
> Protect GC registers in amdgpu_irq_disable_all() and amdgpu_fence_driver_hw_fini().
>
Probably refine to keep it generic like "Protect all IP register
accesses if in powergated state like gfxoff"
> Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Thanks,
Lijo
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index e69ab8a923e3..095730c7ef8f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3506,9 +3506,6 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
> }
> }
>
> - amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
> - amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
> -
> amdgpu_amdkfd_suspend(adev, true);
> amdgpu_amdkfd_teardown_processes(adev);
> amdgpu_userq_suspend(adev);
> @@ -4904,6 +4901,9 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
> amdgpu_virt_fini_data_exchange(adev);
> }
>
> + amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
> + amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
> +
> /* disable all interrupts */
> amdgpu_irq_disable_all(adev);
> if (adev->mode_info.mode_config_initialized) {
> @@ -7362,6 +7362,9 @@ void amdgpu_device_halt(struct amdgpu_device *adev)
> amdgpu_xcp_dev_unplug(adev);
> drm_dev_unplug(ddev);
>
> + amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
> + amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
> +
> amdgpu_irq_disable_all(adev);
>
> amdgpu_fence_driver_hw_fini(adev);
prev parent reply other threads:[~2026-02-02 7:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 6:31 [PATCH] drm/amdgpu: Put GPU CG/PG ungate in device_fini_hw and device_halt Yifan Zhang
2026-02-02 7:11 ` Lazar, Lijo [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=7b087ad3-e18d-407f-8e97-5ee35e564fd8@amd.com \
--to=lijo.lazar@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=yifan1.zhang@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