From: "Khatri, Sunil" <sukhatri@amd.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/4] drm/sdma6: properly reference trap interrupts for userqs
Date: Mon, 14 Apr 2025 15:28:33 +0530 [thread overview]
Message-ID: <36ea9a52-9a39-484a-8100-bde07d320db2@amd.com> (raw)
In-Reply-To: <20250413160608.2198429-3-alexander.deucher@amd.com>
Same explanation as patch 1 of the series here too. Do we want to depend
on the disable_kq flag solely to enable/disable sdma trap.
IIUC, we dont want to do it in case of kernel queues at all and only
needed when using userqueue and that is taken care by using the flag
disable_kq.
Regards
Sunil Khatri
On 4/13/2025 9:36 PM, Alex Deucher wrote:
> We need to take a reference to the interrupts to make
> sure they stay enabled even if the kernel queues have
> disabled them.
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 31 +++++++++++++++++++++++++-
> 1 file changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index 2249a1ef057bf..c3d53974e7f53 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -1377,11 +1377,39 @@ static int sdma_v6_0_sw_fini(struct amdgpu_ip_block *ip_block)
> return 0;
> }
>
> +static int sdma_v6_0_set_userq_trap_interrupts(struct amdgpu_device *adev,
> + bool enable)
> +{
> + unsigned int irq_type;
> + int i, r;
> +
> + if (adev->userq_funcs[AMDGPU_HW_IP_DMA]) {
> + for (i = 0; i < adev->sdma.num_instances; i++) {
> + irq_type = AMDGPU_SDMA_IRQ_INSTANCE0 + i;
> + if (enable)
> + r = amdgpu_irq_get(adev, &adev->sdma.trap_irq,
> + irq_type);
> + else
> + r = amdgpu_irq_put(adev, &adev->sdma.trap_irq,
> + irq_type);
> + if (r)
> + return r;
> + }
> + }
> +
> + return 0;
> +}
> +
> static int sdma_v6_0_hw_init(struct amdgpu_ip_block *ip_block)
> {
> struct amdgpu_device *adev = ip_block->adev;
> + int r;
>
> - return sdma_v6_0_start(adev);
> + r = sdma_v6_0_start(adev);
> + if (r)
> + return r;
> +
> + return sdma_v6_0_set_userq_trap_interrupts(adev, true);
> }
>
> static int sdma_v6_0_hw_fini(struct amdgpu_ip_block *ip_block)
> @@ -1393,6 +1421,7 @@ static int sdma_v6_0_hw_fini(struct amdgpu_ip_block *ip_block)
>
> sdma_v6_0_ctxempty_int_enable(adev, false);
> sdma_v6_0_enable(adev, false);
> + sdma_v6_0_set_userq_trap_interrupts(adev, false);
>
> return 0;
> }
next prev parent reply other threads:[~2025-04-14 9:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-13 16:06 [PATCH 1/4] drm/amdgpu/gfx11: properly reference EOP interrupts for userqs Alex Deucher
2025-04-13 16:06 ` [PATCH 2/4] drm/amdgpu/gfx12: " Alex Deucher
2025-04-13 16:06 ` [PATCH 3/4] drm/sdma6: properly reference trap " Alex Deucher
2025-04-14 9:58 ` Khatri, Sunil [this message]
2025-04-14 15:32 ` Alex Deucher
2025-04-14 17:35 ` Khatri, Sunil
2025-04-13 16:06 ` [PATCH 4/4] drm/sdma7: " Alex Deucher
2025-04-14 17:35 ` Khatri, Sunil
2025-04-14 9:42 ` [PATCH 1/4] drm/amdgpu/gfx11: properly reference EOP " Khatri, Sunil
2025-04-14 9:51 ` Khatri, Sunil
2025-04-14 15:29 ` Alex Deucher
2025-04-14 17:17 ` Khatri, Sunil
2025-04-14 17:24 ` Alex Deucher
2025-04-14 17:33 ` Khatri, Sunil
2025-04-14 17:42 ` Khatri, Sunil
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=36ea9a52-9a39-484a-8100-bde07d320db2@amd.com \
--to=sukhatri@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.