AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd: Turn off doorbell for vcn 4.0.5
@ 2025-05-10 19:02 Mario Limonciello
  2025-05-13  1:59 ` Mario Limonciello
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Limonciello @ 2025-05-10 19:02 UTC (permalink / raw)
  To: amd-gfx; +Cc: Mario Limonciello, stable, David.Wu3

From: Mario Limonciello <mario.limonciello@amd.com>

On VCN 4.0.5 using a doorbell to notify VCN hardware for WPTR changes
while dynamic power gating is enabled introduces a timing dependency
that can sometimes cause WPTR to not be properly updated. This manifests
as a job timeout which will trigger a VCN reset and cause the application
that submitted the job to crash.

Writing directly to the WPTR register instead of using the doorbell changes
the timing enough that the issue doesn't happen. Turn off doorbell use for
now while the issue continues to be debugged.

Cc: stable@vger.kernel.org
Cc: David.Wu3@amd.com
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12528
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3909
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
index ba603b2246e2e..ea9513f65d7e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
@@ -181,7 +181,7 @@ static int vcn_v4_0_5_sw_init(struct amdgpu_ip_block *ip_block)
 			return r;
 
 		ring = &adev->vcn.inst[i].ring_enc[0];
-		ring->use_doorbell = true;
+		ring->use_doorbell = false;
 		if (amdgpu_sriov_vf(adev))
 			ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
 						i * (adev->vcn.inst[i].num_enc_rings + 1) + 1;
-- 
2.43.0


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

* Re: [PATCH] drm/amd: Turn off doorbell for vcn 4.0.5
  2025-05-10 19:02 [PATCH] drm/amd: Turn off doorbell for vcn 4.0.5 Mario Limonciello
@ 2025-05-13  1:59 ` Mario Limonciello
  0 siblings, 0 replies; 2+ messages in thread
From: Mario Limonciello @ 2025-05-13  1:59 UTC (permalink / raw)
  To: Mario Limonciello, amd-gfx; +Cc: stable, David.Wu3

On 5/10/2025 2:02 PM, Mario Limonciello wrote:
> From: Mario Limonciello <mario.limonciello@amd.com>
> 
> On VCN 4.0.5 using a doorbell to notify VCN hardware for WPTR changes
> while dynamic power gating is enabled introduces a timing dependency
> that can sometimes cause WPTR to not be properly updated. This manifests
> as a job timeout which will trigger a VCN reset and cause the application
> that submitted the job to crash.
> 
> Writing directly to the WPTR register instead of using the doorbell changes
> the timing enough that the issue doesn't happen. Turn off doorbell use for
> now while the issue continues to be debugged.
> 
> Cc: stable@vger.kernel.org
> Cc: David.Wu3@amd.com
> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12528
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3909
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
> index ba603b2246e2e..ea9513f65d7e4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
> @@ -181,7 +181,7 @@ static int vcn_v4_0_5_sw_init(struct amdgpu_ip_block *ip_block)
>   			return r;
>   
>   		ring = &adev->vcn.inst[i].ring_enc[0];
> -		ring->use_doorbell = true;
> +		ring->use_doorbell = false;
>   		if (amdgpu_sriov_vf(adev))
>   			ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
>   						i * (adev->vcn.inst[i].num_enc_rings + 1) + 1;

Although this is confirmed to help the issue David found the correct 
solution.  I expect he'll submit that this week and it will supersede my 
patch.

https://gitlab.freedesktop.org/-/project/176/uploads/defeac39ec232976c7c82aab151bfe63/0001-drm-amdgpu-read-back-DB_CTRL-register-after-write-fo.patch



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

end of thread, other threads:[~2025-05-13  1:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-10 19:02 [PATCH] drm/amd: Turn off doorbell for vcn 4.0.5 Mario Limonciello
2025-05-13  1:59 ` Mario Limonciello

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