From: Frank Li <Frank.li@nxp.com>
To: Koichiro Den <den@valinux.co.jp>
Cc: mani@kernel.org, vkoul@kernel.org, Frank.Li@kernel.org,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] dmaengine: dw-edma: Add interrupt-emulation hooks
Date: Mon, 16 Feb 2026 11:38:58 -0500 [thread overview]
Message-ID: <aZNIIjlEYVbWpIn5@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260215152216.3393561-2-den@valinux.co.jp>
On Mon, Feb 16, 2026 at 12:22:15AM +0900, Koichiro Den wrote:
> DesignWare eDMA instances support "interrupt emulation", where a
> software write can assert the IRQ line without setting the normal
> DONE/ABORT status bits.
>
> Introduce core callbacks needed to support this feature:
>
> - .ack_emulated_irq(): core-specific sequence to deassert an emulated
> IRQ
> - .db_offset(): offset from the DMA register base that is suitable as a
> host-writable doorbell target for interrupt emulation
>
> Implement both hooks for the v0 register map. For dw-hdma-v0, provide a
> stub .db_offset() returning ~0 until the correct offset is known.
>
> The next patch wires these hooks into the dw-edma IRQ path and exports
> the doorbell resources to platform users.
>
> Signed-off-by: Koichiro Den <den@valinux.co.jp>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/dw-edma/dw-edma-core.h | 17 +++++++++++++++++
> drivers/dma/dw-edma/dw-edma-v0-core.c | 21 +++++++++++++++++++++
> drivers/dma/dw-edma/dw-hdma-v0-core.c | 7 +++++++
> 3 files changed, 45 insertions(+)
>
> diff --git a/drivers/dma/dw-edma/dw-edma-core.h b/drivers/dma/dw-edma/dw-edma-core.h
> index 71894b9e0b15..59b24973fa7d 100644
> --- a/drivers/dma/dw-edma/dw-edma-core.h
> +++ b/drivers/dma/dw-edma/dw-edma-core.h
> @@ -126,6 +126,8 @@ struct dw_edma_core_ops {
> void (*start)(struct dw_edma_chunk *chunk, bool first);
> void (*ch_config)(struct dw_edma_chan *chan);
> void (*debugfs_on)(struct dw_edma *dw);
> + void (*ack_emulated_irq)(struct dw_edma *dw);
> + resource_size_t (*db_offset)(struct dw_edma *dw);
> };
>
> struct dw_edma_sg {
> @@ -206,4 +208,19 @@ void dw_edma_core_debugfs_on(struct dw_edma *dw)
> dw->core->debugfs_on(dw);
> }
>
> +static inline int dw_edma_core_ack_emulated_irq(struct dw_edma *dw)
> +{
> + if (!dw->core->ack_emulated_irq)
> + return -EOPNOTSUPP;
> +
> + dw->core->ack_emulated_irq(dw);
> + return 0;
> +}
> +
> +static inline resource_size_t
> +dw_edma_core_db_offset(struct dw_edma *dw)
> +{
> + return dw->core->db_offset(dw);
> +}
> +
> #endif /* _DW_EDMA_CORE_H */
> diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c
> index b75fdaffad9a..69e8279adec8 100644
> --- a/drivers/dma/dw-edma/dw-edma-v0-core.c
> +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c
> @@ -509,6 +509,25 @@ static void dw_edma_v0_core_debugfs_on(struct dw_edma *dw)
> dw_edma_v0_debugfs_on(dw);
> }
>
> +static void dw_edma_v0_core_ack_emulated_irq(struct dw_edma *dw)
> +{
> + /*
> + * Interrupt emulation may assert the IRQ without setting
> + * DONE/ABORT status bits. A zero write to INT_CLEAR deasserts the
> + * emulated IRQ, while being a no-op for real interrupts.
> + */
> + SET_BOTH_32(dw, int_clear, 0);
> +}
> +
> +static resource_size_t dw_edma_v0_core_db_offset(struct dw_edma *dw)
> +{
> + /*
> + * rd_int_status is chosen arbitrarily, but wr_int_status would be
> + * equally suitable.
> + */
> + return offsetof(struct dw_edma_v0_regs, rd_int_status);
> +}
> +
> static const struct dw_edma_core_ops dw_edma_v0_core = {
> .off = dw_edma_v0_core_off,
> .ch_count = dw_edma_v0_core_ch_count,
> @@ -517,6 +536,8 @@ static const struct dw_edma_core_ops dw_edma_v0_core = {
> .start = dw_edma_v0_core_start,
> .ch_config = dw_edma_v0_core_ch_config,
> .debugfs_on = dw_edma_v0_core_debugfs_on,
> + .ack_emulated_irq = dw_edma_v0_core_ack_emulated_irq,
> + .db_offset = dw_edma_v0_core_db_offset,
> };
>
> void dw_edma_v0_core_register(struct dw_edma *dw)
> diff --git a/drivers/dma/dw-edma/dw-hdma-v0-core.c b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> index e3f8db4fe909..1ae8e44f0a67 100644
> --- a/drivers/dma/dw-edma/dw-hdma-v0-core.c
> +++ b/drivers/dma/dw-edma/dw-hdma-v0-core.c
> @@ -283,6 +283,12 @@ static void dw_hdma_v0_core_debugfs_on(struct dw_edma *dw)
> dw_hdma_v0_debugfs_on(dw);
> }
>
> +static resource_size_t dw_hdma_v0_core_db_offset(struct dw_edma *dw)
> +{
> + /* Implement once the correct offset is known. */
> + return ~0;
> +}
> +
> static const struct dw_edma_core_ops dw_hdma_v0_core = {
> .off = dw_hdma_v0_core_off,
> .ch_count = dw_hdma_v0_core_ch_count,
> @@ -291,6 +297,7 @@ static const struct dw_edma_core_ops dw_hdma_v0_core = {
> .start = dw_hdma_v0_core_start,
> .ch_config = dw_hdma_v0_core_ch_config,
> .debugfs_on = dw_hdma_v0_core_debugfs_on,
> + .db_offset = dw_hdma_v0_core_db_offset,
> };
>
> void dw_hdma_v0_core_register(struct dw_edma *dw)
> --
> 2.51.0
>
next prev parent reply other threads:[~2026-02-16 16:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-15 15:22 [PATCH 0/2] dmaengine: dw-edma: Interrupt-emulation doorbell support Koichiro Den
2026-02-15 15:22 ` [PATCH 1/2] dmaengine: dw-edma: Add interrupt-emulation hooks Koichiro Den
2026-02-16 16:38 ` Frank Li [this message]
2026-03-24 2:10 ` Koichiro Den
2026-02-15 15:22 ` [PATCH 2/2] dmaengine: dw-edma: Add virtual IRQ for interrupt-emulation doorbells Koichiro Den
2026-02-16 16:38 ` Frank Li
2026-02-18 16:19 ` [PATCH 0/2] dmaengine: dw-edma: Interrupt-emulation doorbell support Koichiro Den
2026-02-18 16:50 ` Niklas Cassel
2026-02-25 11:24 ` Vinod Koul
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=aZNIIjlEYVbWpIn5@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=Frank.Li@kernel.org \
--cc=den@valinux.co.jp \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=vkoul@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
all inboxes | Powered by JetHome®