From dea1ce54dd4966f62ce61d48eee1084a2b89cf1a Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Wed, 24 Jun 2026 13:50:43 -0400 Subject: [PATCH] drm/amdgpu: Increase UALink soft ring size The UALink soft ring overflows under bursts of interrupts from remote GPUs. Size it at 16x the default soft ring to absorb the burst. While here, read the source accel_id and context dwords before the delegate path and log them, so the originating GPU is recorded for every interrupt. Signed-off-by: Philip Yang Reviewed-by: Mukul Joshi Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 17 ++++++++--------- drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h index 11f834c97d93..8d74a89b40cf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h @@ -30,6 +30,7 @@ #define IH_RING_SIZE (256 * 1024) #define IH_SW_RING_SIZE (16 * 1024) /* enough for 512 CAM entries */ #define IH_PSP_RING_SIZE (SZ_4K) +#define IH_UALINK_RING_SIZE (256 * 1024) struct amdgpu_device; struct amdgpu_iv_entry; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c index 23cd6f564dd2..d11051a33910 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c @@ -5404,13 +5404,6 @@ static int amdgpu_ualink_process_irq(struct amdgpu_device *adev, entry->ih == &adev->irq.ih ? "ring" : "ualink soft ring", entry->client_id, entry->src_id); - /* Copy IH entry into ualink soft ring. */ - if (entry->ih == &adev->irq.ih) { - dev_dbg(adev->dev, "delegate to ualink irq soft ring\n"); - amdgpu_irq_ualink_delegate(adev, entry, 8); - return handled; - } - /* ContextID 4 dwords */ src_acc_id = entry->pasid; dw0 = entry->src_data[0]; @@ -5418,8 +5411,14 @@ static int amdgpu_ualink_process_irq(struct amdgpu_device *adev, dw2 = entry->src_data[2]; dw3 = entry->src_data[3]; - dev_dbg(adev->dev, "src accel_id %u context id 0x%x 0x%x 0x%x 0x%x\n", - src_acc_id, dw0, dw1, dw2, dw3); + /* Copy IH entry into ualink soft ring. */ + if (entry->ih == &adev->irq.ih) { + dev_dbg(adev->dev, "src accel_id %u context id 0x%x 0x%x 0x%x 0x%x\n", + src_acc_id, dw0, dw1, dw2, dw3); + dev_dbg(adev->dev, "delegate to ualink irq soft ring\n"); + amdgpu_irq_ualink_delegate(adev, entry, 8); + return handled; + } msg_type = dw0 & AMDGPU_UALINK_MESSAGE_HEADER_MASK; local_acc_id = adev->ualink.info->ppod.accel_id; diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c index c93ef937c430..3745439b86b3 100644 --- a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c @@ -643,7 +643,7 @@ static int ih_v7_0_sw_init(struct amdgpu_ip_block *ip_block) return r; dev_dbg(adev->dev, "ualink init ih_ualink\n"); - r = amdgpu_ih_ring_init(adev, &adev->irq.ih_ualink, sw_ring_size, true); + r = amdgpu_ih_ring_init(adev, &adev->irq.ih_ualink, IH_UALINK_RING_SIZE, true); if (r) return r;