public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: vkoul@kernel.org
Cc: dmaengine@vger.kernel.org
Subject: Re: [PATCH] dmaengine: idxd: add missing callback function to support DMA_INTERRUPT
Date: Mon, 16 May 2022 10:02:01 -0700	[thread overview]
Message-ID: <8da7b5af-4536-6c9e-378a-e4313a6171f9@intel.com> (raw)
In-Reply-To: <165101232637.3951447.15765792791591763119.stgit@djiang5-desk3.ch.intel.com>


On 4/26/2022 3:32 PM, Dave Jiang wrote:
> When setting DMA_INTERRUPT capability, a callback function
> dma->device_prep_dma_interrupt() is needed to support this capability.
> Without setting the callback, dma_async_device_register() will fail dma
> capability check.
>
> Fixes: 4e5a4eb20393 ("dmaengine: idxd: set DMA_INTERRUPT cap bit")
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>


Hi Vinod, can you please make sure this patch goes into the merge 
window? It fixes the patch that's in the dmaengine/next. Thanks!

> ---
>   drivers/dma/idxd/dma.c |   22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/drivers/dma/idxd/dma.c b/drivers/dma/idxd/dma.c
> index 950f06c8aad5..d66cef5a918e 100644
> --- a/drivers/dma/idxd/dma.c
> +++ b/drivers/dma/idxd/dma.c
> @@ -87,6 +87,27 @@ static inline void idxd_prep_desc_common(struct idxd_wq *wq,
>   	hw->completion_addr = compl;
>   }
>   
> +static struct dma_async_tx_descriptor *
> +idxd_dma_prep_interrupt(struct dma_chan *c, unsigned long flags)
> +{
> +	struct idxd_wq *wq = to_idxd_wq(c);
> +	u32 desc_flags;
> +	struct idxd_desc *desc;
> +
> +	if (wq->state != IDXD_WQ_ENABLED)
> +		return NULL;
> +
> +	op_flag_setup(flags, &desc_flags);
> +	desc = idxd_alloc_desc(wq, IDXD_OP_BLOCK);
> +	if (IS_ERR(desc))
> +		return NULL;
> +
> +	idxd_prep_desc_common(wq, desc->hw, DSA_OPCODE_NOOP,
> +			      0, 0, 0, desc->compl_dma, desc_flags);
> +	desc->txd.flags = flags;
> +	return &desc->txd;
> +}
> +
>   static struct dma_async_tx_descriptor *
>   idxd_dma_submit_memcpy(struct dma_chan *c, dma_addr_t dma_dest,
>   		       dma_addr_t dma_src, size_t len, unsigned long flags)
> @@ -198,6 +219,7 @@ int idxd_register_dma_device(struct idxd_device *idxd)
>   	dma_cap_set(DMA_COMPLETION_NO_ORDER, dma->cap_mask);
>   	dma->device_release = idxd_dma_release;
>   
> +	dma->device_prep_dma_interrupt = idxd_dma_prep_interrupt;
>   	if (idxd->hw.opcap.bits[0] & IDXD_OPCAP_MEMMOVE) {
>   		dma_cap_set(DMA_MEMCPY, dma->cap_mask);
>   		dma->device_prep_dma_memcpy = idxd_dma_submit_memcpy;
>
>

  reply	other threads:[~2022-05-16 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26 22:32 [PATCH] dmaengine: idxd: add missing callback function to support DMA_INTERRUPT Dave Jiang
2022-05-16 17:02 ` Dave Jiang [this message]
2022-05-16 17:48 ` 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=8da7b5af-4536-6c9e-378a-e4313a6171f9@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dmaengine@vger.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