From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
amd-gfx@lists.freedesktop.org, Yifan Zhang <yifan1.zhang@amd.com>
Subject: Re: [PATCH 01/12] drm/amdgpu/gfx9: handle gfxoff in interrupt set functions
Date: Sat, 31 Jan 2026 11:34:55 +0530 [thread overview]
Message-ID: <cc77cc03-b9b8-46a7-bdf1-237a9c239ba8@amd.com> (raw)
In-Reply-To: <CADnq5_M-CoUDrWs9nOUSUF5yM+Jq2+RY1WS6mYGbWVYmtxgA8w@mail.gmail.com>
On 30-Jan-26 9:19 PM, Alex Deucher wrote:
> On Fri, Jan 30, 2026 at 10:05 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>>
>>
>>
>> On 30-Jan-26 8:18 PM, Alex Deucher wrote:
>>> On Tue, Jan 27, 2026 at 12:02 AM Lazar, Lijo <lijo.lazar@amd.com> wrote:
>>>>
>>>>
>>>>
>>>> On 27-Jan-26 1:37 AM, Alex Deucher wrote:
>>>>> Need to make sure gfxoff is disallowed when we touch GC
>>>>> registers over MMIO.
>>>>>
>>>>
>>>> I think interrupt enable/disable sequence is only supposed to be done
>>>> under ip power/clock ungate sequence like in hw init/resume/suspend
>>>> sequences. The fix probably should be in the higher level sequence which
>>>> doesn't take care of that.
>>>
>>> In that case, Yifan's original patch is probably fine as is. Someone
>>> should still double check all of the call paths though.
>>>
>>
>> Original one is also not correct. For example, if this is happening
>> after reset re initialization, only that sequence needs to be modified
>> to keep the affected IPs ungated during reinit.
>
> It also gets called in amdgpu_device_fini_hw().
>
Checked now. What I meant is - we should call ip cg/pg ungate insid
amdgpu_device_fini_hw() to protect all other accesses within that
sequence and not restricted to irq_disable/enable all. Now that happens
a while later in amdgpu_device_ip_fini_early.
Basically, the high level sequence needs IP pg ungate protection.
Thanks,
Lijo
> Alex
>
>>
>> Thanks,
>> Lijo
>>
>>> Alex
>>>
>>>>
>>>> Thanks,
>>>> Lijo
>>>>
>>>>> Cc: Yifan Zhang <yifan1.zhang@amd.com>
>>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>>> ---
>>>>> drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 10 ++++++++++
>>>>> 1 file changed, 10 insertions(+)
>>>>>
>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>>>>> index 36f0300a21bfa..05178ee8e0e3a 100644
>>>>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
>>>>> @@ -6056,6 +6056,7 @@ static int gfx_v9_0_set_priv_reg_fault_state(struct amdgpu_device *adev,
>>>>> u32 cp_int_cntl_reg, cp_int_cntl;
>>>>> int i, j;
>>>>>
>>>>> + amdgpu_gfx_off_ctrl(adev, false);
>>>>> switch (state) {
>>>>> case AMDGPU_IRQ_STATE_DISABLE:
>>>>> case AMDGPU_IRQ_STATE_ENABLE:
>>>>> @@ -6080,6 +6081,7 @@ static int gfx_v9_0_set_priv_reg_fault_state(struct amdgpu_device *adev,
>>>>> default:
>>>>> break;
>>>>> }
>>>>> + amdgpu_gfx_off_ctrl(adev, true);
>>>>>
>>>>> return 0;
>>>>> }
>>>>> @@ -6092,6 +6094,7 @@ static int gfx_v9_0_set_bad_op_fault_state(struct amdgpu_device *adev,
>>>>> u32 cp_int_cntl_reg, cp_int_cntl;
>>>>> int i, j;
>>>>>
>>>>> + amdgpu_gfx_off_ctrl(adev, false);
>>>>> switch (state) {
>>>>> case AMDGPU_IRQ_STATE_DISABLE:
>>>>> case AMDGPU_IRQ_STATE_ENABLE:
>>>>> @@ -6116,6 +6119,7 @@ static int gfx_v9_0_set_bad_op_fault_state(struct amdgpu_device *adev,
>>>>> default:
>>>>> break;
>>>>> }
>>>>> + amdgpu_gfx_off_ctrl(adev, true);
>>>>>
>>>>> return 0;
>>>>> }
>>>>> @@ -6125,6 +6129,7 @@ static int gfx_v9_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
>>>>> unsigned type,
>>>>> enum amdgpu_interrupt_state state)
>>>>> {
>>>>> + amdgpu_gfx_off_ctrl(adev, false);
>>>>> switch (state) {
>>>>> case AMDGPU_IRQ_STATE_DISABLE:
>>>>> case AMDGPU_IRQ_STATE_ENABLE:
>>>>> @@ -6135,6 +6140,7 @@ static int gfx_v9_0_set_priv_inst_fault_state(struct amdgpu_device *adev,
>>>>> default:
>>>>> break;
>>>>> }
>>>>> + amdgpu_gfx_off_ctrl(adev, true);
>>>>>
>>>>> return 0;
>>>>> }
>>>>> @@ -6152,6 +6158,7 @@ static int gfx_v9_0_set_cp_ecc_error_state(struct amdgpu_device *adev,
>>>>> unsigned type,
>>>>> enum amdgpu_interrupt_state state)
>>>>> {
>>>>> + amdgpu_gfx_off_ctrl(adev, false);
>>>>> switch (state) {
>>>>> case AMDGPU_IRQ_STATE_DISABLE:
>>>>> WREG32_FIELD15(GC, 0, CP_INT_CNTL_RING0,
>>>>> @@ -6173,6 +6180,7 @@ static int gfx_v9_0_set_cp_ecc_error_state(struct amdgpu_device *adev,
>>>>> default:
>>>>> break;
>>>>> }
>>>>> + amdgpu_gfx_off_ctrl(adev, true);
>>>>>
>>>>> return 0;
>>>>> }
>>>>> @@ -6183,6 +6191,7 @@ static int gfx_v9_0_set_eop_interrupt_state(struct amdgpu_device *adev,
>>>>> unsigned type,
>>>>> enum amdgpu_interrupt_state state)
>>>>> {
>>>>> + amdgpu_gfx_off_ctrl(adev, false);
>>>>> switch (type) {
>>>>> case AMDGPU_CP_IRQ_GFX_ME0_PIPE0_EOP:
>>>>> gfx_v9_0_set_gfx_eop_interrupt_state(adev, state);
>>>>> @@ -6214,6 +6223,7 @@ static int gfx_v9_0_set_eop_interrupt_state(struct amdgpu_device *adev,
>>>>> default:
>>>>> break;
>>>>> }
>>>>> + amdgpu_gfx_off_ctrl(adev, true);
>>>>> return 0;
>>>>> }
>>>>>
>>>>
>>
next prev parent reply other threads:[~2026-01-31 6:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 20:07 [PATCH 01/12] drm/amdgpu/gfx9: handle gfxoff in interrupt set functions Alex Deucher
2026-01-26 20:07 ` [PATCH 02/12] drm/amdgpu/gmc9: " Alex Deucher
2026-01-26 20:07 ` [PATCH 03/12] drm/amdgpu/gfx10: " Alex Deucher
2026-01-26 20:07 ` [PATCH 04/12] drm/amdgpu/gmc9: " Alex Deucher
2026-01-26 20:48 ` Alex Deucher
2026-01-27 0:34 ` Zhang, Yifan
2026-01-26 20:07 ` [PATCH 05/12] drm/amdgpu/sdma5: " Alex Deucher
2026-01-26 20:07 ` [PATCH 06/12] drm/amdgpu/sdma5.2: " Alex Deucher
2026-01-26 20:07 ` [PATCH 07/12] drm/amdgpu/gfx11: " Alex Deucher
2026-01-26 20:07 ` [PATCH 08/12] drm/amdgpu/sdma6: " Alex Deucher
2026-01-26 20:07 ` [PATCH 09/12] drm/amdgpu/gfx12: " Alex Deucher
2026-01-26 20:07 ` [PATCH 10/12] drm/amdgpu/gfx12.1: " Alex Deucher
2026-01-26 20:07 ` [PATCH 11/12] drm/amdgpu/sdma7: " Alex Deucher
2026-01-26 20:07 ` [PATCH 12/12] drm/amdgpu/sdma7.1: " Alex Deucher
2026-01-27 4:52 ` [PATCH 01/12] drm/amdgpu/gfx9: " Lazar, Lijo
2026-01-30 14:48 ` Alex Deucher
2026-01-30 15:05 ` Lazar, Lijo
2026-01-30 15:49 ` Alex Deucher
2026-01-31 6:04 ` Lazar, Lijo [this message]
2026-02-02 6:33 ` Zhang, Yifan
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=cc77cc03-b9b8-46a7-bdf1-237a9c239ba8@amd.com \
--to=lijo.lazar@amd.com \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.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