AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3
@ 2026-01-27  7:39 Jesse.Zhang
  2026-01-27  8:13 ` Lazar, Lijo
  0 siblings, 1 reply; 2+ messages in thread
From: Jesse.Zhang @ 2026-01-27  7:39 UTC (permalink / raw)
  To: amd-gfx
  Cc: Alexander.Deucher, Christian Koenig, lijo.lazar, Jesse.Zhang,
	Jesse Zhang

Fix the vcn reset sequence in vcn_v4_0_3_ring_reset() to restore
JPEG power state and unlock the JPEG powergating mutex before
running the JPEG ring post-reset helper.

Fixes: c50beca39115 ("drm/amdgpu/vcn4.0.3: rework reset handling")

Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index dd247abce1ab..e78526a4e521 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -1742,11 +1742,11 @@ static int vcn_v4_0_3_ring_reset(struct amdgpu_ring *ring,
 		goto unlock;
 	}
 
-	r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
 	if (pg_state)
 		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_JPEG,
 						       AMD_PG_STATE_GATE);
 	mutex_unlock(&adev->jpeg.jpeg_pg_lock);
+	r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
 
 unlock:
 	mutex_unlock(&vinst->engine_reset_mutex);
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3
  2026-01-27  7:39 [PATCH] drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3 Jesse.Zhang
@ 2026-01-27  8:13 ` Lazar, Lijo
  0 siblings, 0 replies; 2+ messages in thread
From: Lazar, Lijo @ 2026-01-27  8:13 UTC (permalink / raw)
  To: Jesse.Zhang, amd-gfx; +Cc: Alexander.Deucher, Christian Koenig



On 27-Jan-26 1:09 PM, Jesse.Zhang wrote:
> Fix the vcn reset sequence in vcn_v4_0_3_ring_reset() to restore
> JPEG power state and unlock the JPEG powergating mutex before
> running the JPEG ring post-reset helper.
> 
> Fixes: c50beca39115 ("drm/amdgpu/vcn4.0.3: rework reset handling")
> 
> Signed-off-by: Jesse Zhang <jesse.zhang@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
> index dd247abce1ab..e78526a4e521 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
> @@ -1742,11 +1742,11 @@ static int vcn_v4_0_3_ring_reset(struct amdgpu_ring *ring,
>   		goto unlock;
>   	}
>   
> -	r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
>   	if (pg_state)
>   		amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_JPEG,
>   						       AMD_PG_STATE_GATE);
>   	mutex_unlock(&adev->jpeg.jpeg_pg_lock);

Probably, we can revisit this later since ring test logic will make sure 
that jpeg will get eventually power gated if not in use.

	Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>

Thanks,
Lijo

> +	r = vcn_v4_0_3_reset_jpeg_post_helper(adev, ring->me);
>   
>   unlock:
>   	mutex_unlock(&vinst->engine_reset_mutex);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-27  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27  7:39 [PATCH] drm/amdgpu: Fix jpeg ring test order in vcn_v4_0_3 Jesse.Zhang
2026-01-27  8:13 ` Lazar, Lijo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox