]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jun 2022 18:07:03 +0000 (20:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Jun 2022 18:07:03 +0000 (20:07 +0200)
added patches:
dmaengine-idxd-add-missing-callback-function-to-support-dma_interrupt.patch

queue-5.10/dmaengine-idxd-add-missing-callback-function-to-support-dma_interrupt.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/dmaengine-idxd-add-missing-callback-function-to-support-dma_interrupt.patch b/queue-5.10/dmaengine-idxd-add-missing-callback-function-to-support-dma_interrupt.patch
new file mode 100644 (file)
index 0000000..ff9e201
--- /dev/null
@@ -0,0 +1,61 @@
+From 2112b8f4fb5cc35d1c384324763765953186b81f Mon Sep 17 00:00:00 2001
+From: Dave Jiang <dave.jiang@intel.com>
+Date: Tue, 26 Apr 2022 15:32:06 -0700
+Subject: dmaengine: idxd: add missing callback function to support DMA_INTERRUPT
+
+From: Dave Jiang <dave.jiang@intel.com>
+
+commit 2112b8f4fb5cc35d1c384324763765953186b81f upstream.
+
+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>
+Link: https://lore.kernel.org/r/165101232637.3951447.15765792791591763119.stgit@djiang5-desk3.ch.intel.com
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/dma/idxd/dma.c |   22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+--- a/drivers/dma/idxd/dma.c
++++ b/drivers/dma/idxd/dma.c
+@@ -83,6 +83,27 @@ static inline void idxd_prep_desc_common
+ }
+ 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)
+ {
+@@ -193,6 +214,7 @@ int idxd_register_dma_device(struct 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;
index 2de3083674c7c5c821a4a70572435d0a1f7fb92f..25fcf96b15f5de2f416838636493229c211e4ecd 100644 (file)
@@ -170,3 +170,4 @@ interconnect-restore-sync-state-by-ignoring-ipa-virt-in-provider-count.patch
 md-raid0-ignore-raid0-layout-if-the-second-zone-has-only-one-device.patch
 pci-qcom-fix-pipe-clock-imbalance.patch
 zonefs-fix-handling-of-explicit_open-option-on-mount.patch
+dmaengine-idxd-add-missing-callback-function-to-support-dma_interrupt.patch