AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: "Christian König" <christian.koenig@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org
Cc: "Timur Kristóf" <timur.kristof@gmail.com>
Subject: [PATCH 02/10] drm/amdgpu/cik_ih: Enable soft IRQ handler ring
Date: Wed, 26 Nov 2025 14:29:44 +0100	[thread overview]
Message-ID: <20251126132952.150452-3-timur.kristof@gmail.com> (raw)
In-Reply-To: <20251126132952.150452-1-timur.kristof@gmail.com>

We are going to use the soft IRQ handler ring on GMC v7 (CIK)
to process interrupts from VM faults.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/cik_ih.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
index 41f4705bdbbd..876a3256dba4 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
@@ -156,6 +156,9 @@ static int cik_ih_irq_init(struct amdgpu_device *adev)
 	/* enable irqs */
 	cik_ih_enable_interrupts(adev);
 
+	if (adev->irq.ih_soft.ring_size)
+		adev->irq.ih_soft.enabled = true;
+
 	return 0;
 }
 
@@ -192,6 +195,9 @@ static u32 cik_ih_get_wptr(struct amdgpu_device *adev,
 
 	wptr = le32_to_cpu(*ih->wptr_cpu);
 
+	if (ih == &adev->irq.ih_soft)
+		goto out;
+
 	if (wptr & IH_RB_WPTR__RB_OVERFLOW_MASK) {
 		wptr &= ~IH_RB_WPTR__RB_OVERFLOW_MASK;
 		/* When a ring buffer overflow happen start parsing interrupt
@@ -211,6 +217,8 @@ static u32 cik_ih_get_wptr(struct amdgpu_device *adev,
 		tmp &= ~IH_RB_CNTL__WPTR_OVERFLOW_CLEAR_MASK;
 		WREG32(mmIH_RB_CNTL, tmp);
 	}
+
+out:
 	return (wptr & ih->ptr_mask);
 }
 
@@ -306,6 +314,10 @@ static int cik_ih_sw_init(struct amdgpu_ip_block *ip_block)
 	if (r)
 		return r;
 
+	r = amdgpu_ih_ring_init(adev, &adev->irq.ih_soft, IH_SW_RING_SIZE, true);
+	if (r)
+		return r;
+
 	r = amdgpu_irq_init(adev);
 
 	return r;
-- 
2.51.1


  parent reply	other threads:[~2025-11-26 13:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 13:29 [PATCH 00/10] drm/amdgpu: Improve page fault handling on GMC v6-8 Timur Kristóf
2025-11-26 13:29 ` [PATCH 01/10] drm/amdgpu/si_ih: Enable soft IRQ handler ring Timur Kristóf
2025-11-26 13:29 ` Timur Kristóf [this message]
2025-11-26 13:29 ` [PATCH 03/10] drm/amdgpu/iceland_ih: " Timur Kristóf
2025-11-26 13:29 ` [PATCH 04/10] drm/amdgpu/tonga_ih: " Timur Kristóf
2025-11-26 13:29 ` [PATCH 05/10] drm/amdgpu/cz_ih: " Timur Kristóf
2025-11-26 13:29 ` [PATCH 06/10] drm/amdgpu/gmc6: Don't print MC client as it's unknown Timur Kristóf
2025-11-26 13:29 ` [PATCH 07/10] drm/amdgpu/gmc6: Cache VM fault info Timur Kristóf
2025-11-26 13:29 ` [PATCH 08/10] drm/amdgpu/gmc6: Delegate VM faults to soft IRQ handler ring Timur Kristóf
2025-11-26 13:29 ` [PATCH 09/10] drm/amdgpu/gmc7: " Timur Kristóf
2025-11-26 13:29 ` [PATCH 10/10] drm/amdgpu/gmc8: " Timur Kristóf
2025-11-26 14:22 ` [PATCH 00/10] drm/amdgpu: Improve page fault handling on GMC v6-8 Christian König
2025-11-26 14:46   ` Alex Deucher
2025-11-26 15:04     ` 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=20251126132952.150452-3-timur.kristof@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    /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