AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: "Timur Kristóf" <timur.kristof@gmail.com>,
	amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com,
	"Christian König" <christian.koenig@amd.com>,
	"Natalie Vock" <natalie.vock@gmx.de>,
	"Marek Olšák" <maraeo@gmail.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	"Felix Kuehling" <Felix.Kuehling@amd.com>
Subject: Re: [PATCH 4/5] drm/amdgpu/sdma: Use common SDMA legacy queue reset on SDMA v4.4.2
Date: Fri, 28 Aug 2026 21:16:41 +0530	[thread overview]
Message-ID: <f23512ad-4fe1-48cf-988a-25076e20e1ae@amd.com> (raw)
In-Reply-To: <INK-tdebRIGg60kuZ_quww@gmail.com>



On 28-Aug-26 9:06 PM, Timur Kristóf wrote:
> On Friday, August 28, 2026 4:16:15 PM Central European Summer Time Lazar, Lijo
> wrote:
>> On 28-Aug-26 5:37 PM, Timur Kristóf wrote:
>>> Besides sharing code, this additionally adds support for
>>> restoring queue contents after the reset.
>>>
>>> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
>>> ---
>>>
>>>    drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 18 ++----------------
>>>    1 file changed, 2 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c index
>>> 72ea9db939b4..023821848531 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
>>> @@ -1655,20 +1655,6 @@ static bool sdma_v4_4_2_is_queue_selected(struct
>>> amdgpu_device *adev, uint32_t i>
>>>    	return (context_status & SDMA_GFX_CONTEXT_STATUS__SELECTED_MASK)
> != 0;
>>>    
>>>    }
>>>
>>> -static int sdma_v4_4_2_reset_queue(struct amdgpu_ring *ring,
>>> -				   unsigned int vmid,
>>> -				   struct amdgpu_fence
> *timedout_fence)
>>> -{
>>> -	struct amdgpu_device *adev = ring->adev;
>>> -	u32 id = ring->me;
>>> -	int r;
>>> -
>>> -	amdgpu_amdkfd_suspend(adev, true);
>>> -	r = amdgpu_sdma_reset_engine(adev, id, false);
>>
>> The common one passes true, so this doesn't look right.
>>    	amdgpu_sdma_reset_engine(adev, ring->me, true);
>>
>>
>> Thanks,
>> Lijo
> 
> Can you please elaborate more on what you are suggesting here?
> The caller of the queue reset is amdgpu_job_timedout() and that function
> already handles kernel queues.
> 
> 

It passes a false here which takes care of both paging and gfx rings. 
The one in job timeout is a generic one which only looks at the hung ring.

Thanks,
Lijo

>>
>>> -	amdgpu_amdkfd_resume(adev, true);
>>> -	return r;
>>> -}
>>> -
>>>
>>>    static int sdma_v4_4_2_stop_queue(struct amdgpu_ring *ring)
>>>    {
>>>    
>>>    	struct amdgpu_device *adev = ring->adev;
>>>
>>> @@ -2133,7 +2119,7 @@ static const struct amdgpu_ring_funcs
>>> sdma_v4_4_2_ring_funcs = {>
>>>    	.emit_wreg = sdma_v4_4_2_ring_emit_wreg,
>>>    	.emit_reg_wait = sdma_v4_4_2_ring_emit_reg_wait,
>>>    	.emit_reg_write_reg_wait =
> amdgpu_ring_emit_reg_write_reg_wait_helper,
>>>
>>> -	.reset = sdma_v4_4_2_reset_queue,
>>> +	.reset = amdgpu_sdma_reset_queue_legacy,
>>>
>>>    };
>>>    
>>>    static const struct amdgpu_ring_funcs sdma_v4_4_2_page_ring_funcs = {
>>>
>>> @@ -2165,7 +2151,7 @@ static const struct amdgpu_ring_funcs
>>> sdma_v4_4_2_page_ring_funcs = {>
>>>    	.emit_wreg = sdma_v4_4_2_ring_emit_wreg,
>>>    	.emit_reg_wait = sdma_v4_4_2_ring_emit_reg_wait,
>>>    	.emit_reg_write_reg_wait =
> amdgpu_ring_emit_reg_write_reg_wait_helper,
>>>
>>> -	.reset = sdma_v4_4_2_reset_queue,
>>> +	.reset = amdgpu_sdma_reset_queue_legacy,
>>>
>>>    };
>>>    
>>>    static void sdma_v4_4_2_set_ring_funcs(struct amdgpu_device *adev)
> 
> 
> 
> 


  reply	other threads:[~2026-08-28 15:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 12:07 [PATCH 0/5] drm/amdgpu/sdma: Improve existing SDMA queue resets Timur Kristóf
2026-08-28 12:07 ` [PATCH 1/5] drm/amdgpu/sdma: Clear SDMA rings after reset before starting them Timur Kristóf
2026-08-28 12:07 ` [PATCH 2/5] drm/amdgpu/sdma: Remove unimplemented soft_reset() for SDMA and SI DMA Timur Kristóf
2026-08-28 14:21   ` Lazar, Lijo
2026-08-28 12:07 ` [PATCH 3/5] drm/amdgpu/sdma: Move SDMA v5.x queue reset to common code Timur Kristóf
2026-08-28 14:20   ` Lazar, Lijo
2026-08-28 15:37     ` Timur Kristóf
2026-08-28 15:52       ` Alex Deucher
2026-08-28 21:49         ` Timur Kristóf
2026-08-28 15:53       ` Lazar, Lijo
2026-08-28 21:42         ` Timur Kristóf
2026-08-28 12:07 ` [PATCH 4/5] drm/amdgpu/sdma: Use common SDMA legacy queue reset on SDMA v4.4.2 Timur Kristóf
2026-08-28 14:16   ` Lazar, Lijo
2026-08-28 15:36     ` Timur Kristóf
2026-08-28 15:46       ` Lazar, Lijo [this message]
2026-08-28 12:07 ` [PATCH 5/5] drm/amdgpu/sdma: In legacy queue reset function, check if KFD is initialized Timur Kristóf
2026-08-28 14:11   ` Lazar, Lijo
2026-08-28 15:34     ` Timur Kristóf

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=f23512ad-4fe1-48cf-988a-25076e20e1ae@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=maraeo@gmail.com \
    --cc=mario.limonciello@amd.com \
    --cc=natalie.vock@gmx.de \
    --cc=timur.kristof@gmail.com \
    --cc=tursulin@ursulin.net \
    /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