AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Friedrich Vock <friedrich.vock@gmx.de>, amd-gfx@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Joshua Ashton <joshua@froggi.es>,
	stable@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/amdgpu: Process fences on IH overflow
Date: Mon, 15 Jan 2024 11:26:03 +0100	[thread overview]
Message-ID: <ef01b29e-8529-43d2-befc-a3e3d8eaccf9@gmail.com> (raw)
In-Reply-To: <20240114130008.868941-2-friedrich.vock@gmx.de>

Am 14.01.24 um 14:00 schrieb Friedrich Vock:
> If the IH ring buffer overflows, it's possible that fence signal events
> were lost. Check each ring for progress to prevent job timeouts/GPU
> hangs due to the fences staying unsignaled despite the work being done.

That's completely unnecessary and in some cases even harmful.

We already have a timeout handler for that and overflows point to severe 
system problem so they should never occur in a production system.

Regards,
Christian.

>
> Cc: Joshua Ashton <joshua@froggi.es>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org
>
> Signed-off-by: Friedrich Vock <friedrich.vock@gmx.de>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c
> index f3b0aaf3ebc6..2a246db1d3a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c
> @@ -209,6 +209,7 @@ int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih)
>   {
>   	unsigned int count;
>   	u32 wptr;
> +	int i;
>
>   	if (!ih->enabled || adev->shutdown)
>   		return IRQ_NONE;
> @@ -227,6 +228,20 @@ int amdgpu_ih_process(struct amdgpu_device *adev, struct amdgpu_ih_ring *ih)
>   		ih->rptr &= ih->ptr_mask;
>   	}
>
> +	/* If the ring buffer overflowed, we might have lost some fence
> +	 * signal interrupts. Check if there was any activity so the signal
> +	 * doesn't get lost.
> +	 */
> +	if (ih->overflow) {
> +		for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
> +			struct amdgpu_ring *ring = adev->rings[i];
> +
> +			if (!ring || !ring->fence_drv.initialized)
> +				continue;
> +			amdgpu_fence_process(ring);
> +		}
> +	}
> +
>   	amdgpu_ih_set_rptr(adev, ih);
>   	wake_up_all(&ih->wait_process);
>
> --
> 2.43.0
>


  reply	other threads:[~2024-01-15 10:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-14 13:00 [PATCH 1/2] drm/amdgpu: Reset IH OVERFLOW_CLEAR bit after writing rptr Friedrich Vock
2024-01-14 13:00 ` [PATCH 2/2] drm/amdgpu: Process fences on IH overflow Friedrich Vock
2024-01-15 10:26   ` Christian König [this message]
2024-01-15 11:19     ` Friedrich Vock
2024-01-16  7:17       ` Christian König
     [not found] ` <69cec077-4011-4738-bbb0-8fb1e6f52159@gmail.com>
2024-01-15 11:18   ` [PATCH 1/2] drm/amdgpu: Reset IH OVERFLOW_CLEAR bit after writing rptr Friedrich Vock
2024-01-16  7:03     ` Christian König
2024-01-16 10:31       ` Friedrich Vock
2024-01-17 12:27         ` Christian König
2024-01-17 23:00           ` Alex Deucher
2024-01-17 23:44             ` Friedrich Vock
2024-01-18 12:07               ` Christian König
2024-01-19 19:18                 ` Felix Kuehling
2024-01-22 10:10                   ` Christian König
2024-01-22 10:21                     ` Friedrich Vock
2024-01-22 10:45                       ` Friedrich Vock
2024-01-22 13:35                         ` Christian König
2024-01-22 22:39                           ` Joshua Ashton
2024-01-23  9:36                             ` Christian König
2024-01-23 11:35                               ` Friedrich Vock
2024-01-23 12:49                                 ` Christian König
2024-02-02 11:11                                   ` Joshua Ashton
2024-02-02 13:31                                     ` Christian König

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=ef01b29e-8529-43d2-befc-a3e3d8eaccf9@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=friedrich.vock@gmx.de \
    --cc=joshua@froggi.es \
    --cc=stable@vger.kernel.org \
    /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