summaryrefslogtreecommitdiffstats
path: root/drivers/dma/idxd/dma.c
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2021-08-19 09:34:06 -0700
committerVinod Koul <vkoul@kernel.org>2021-08-29 19:14:20 +0530
commitd8071323c5632bdf0a8ef9b9e5662fac43649f9d (patch)
tree4184d8f8eda5c2830302812456daf79d3ba233ba /drivers/dma/idxd/dma.c
parentaac6c0f90799d66b8989be1e056408f33fd99fe6 (diff)
downloadlinux-stable-d8071323c5632bdf0a8ef9b9e5662fac43649f9d.tar.gz
linux-stable-d8071323c5632bdf0a8ef9b9e5662fac43649f9d.tar.bz2
linux-stable-d8071323c5632bdf0a8ef9b9e5662fac43649f9d.zip
dmaengine: idxd: fix setting up priv mode for dwq
DSA spec says WQ priv bit is 0 if the Privileged Mode Enable field of the PCI Express PASID capability is 0 and pasid is enabled. Make sure that the WQCFG priv field is set correctly according to usage type. Reject config if setting up kernel WQ type and no support. Also add the correct priv setup for a descriptor. Fixes: 484f910e93b4 ("dmaengine: idxd: fix wq config registers offset programming") Cc: Ramesh Thomas <ramesh.thomas@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/162939084657.903168.14160019185148244596.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/dma.c')
-rw-r--r--drivers/dma/idxd/dma.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dma/idxd/dma.c b/drivers/dma/idxd/dma.c
index 5c0a4d8a31f5..e0f056c1d1f5 100644
--- a/drivers/dma/idxd/dma.c
+++ b/drivers/dma/idxd/dma.c
@@ -69,7 +69,11 @@ static inline void idxd_prep_desc_common(struct idxd_wq *wq,
hw->src_addr = addr_f1;
hw->dst_addr = addr_f2;
hw->xfer_size = len;
- hw->priv = !!(wq->type == IDXD_WQT_KERNEL);
+ /*
+ * For dedicated WQ, this field is ignored and HW will use the WQCFG.priv
+ * field instead. This field should be set to 1 for kernel descriptors.
+ */
+ hw->priv = 1;
hw->completion_addr = compl;
}