dma.c (0ea8a56de21be24cb79abb03dee79aabcd60a316) dma.c (8e50d392652f20616a136165dff516b86baf5e49)
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#include <linux/init.h>
4#include <linux/kernel.h>
5#include <linux/module.h>
6#include <linux/pci.h>
7#include <linux/device.h>
8#include <linux/io-64-nonatomic-lo-hi.h>

--- 47 unchanged lines hidden (view full) ---

56 *compl_addr = desc->compl_dma;
57}
58
59static inline void idxd_prep_desc_common(struct idxd_wq *wq,
60 struct dsa_hw_desc *hw, char opcode,
61 u64 addr_f1, u64 addr_f2, u64 len,
62 u64 compl, u32 flags)
63{
1// SPDX-License-Identifier: GPL-2.0
2/* Copyright(c) 2019 Intel Corporation. All rights rsvd. */
3#include <linux/init.h>
4#include <linux/kernel.h>
5#include <linux/module.h>
6#include <linux/pci.h>
7#include <linux/device.h>
8#include <linux/io-64-nonatomic-lo-hi.h>

--- 47 unchanged lines hidden (view full) ---

56 *compl_addr = desc->compl_dma;
57}
58
59static inline void idxd_prep_desc_common(struct idxd_wq *wq,
60 struct dsa_hw_desc *hw, char opcode,
61 u64 addr_f1, u64 addr_f2, u64 len,
62 u64 compl, u32 flags)
63{
64 struct idxd_device *idxd = wq->idxd;
65
66 hw->flags = flags;
67 hw->opcode = opcode;
68 hw->src_addr = addr_f1;
69 hw->dst_addr = addr_f2;
70 hw->xfer_size = len;
71 hw->priv = !!(wq->type == IDXD_WQT_KERNEL);
72 hw->completion_addr = compl;
64 hw->flags = flags;
65 hw->opcode = opcode;
66 hw->src_addr = addr_f1;
67 hw->dst_addr = addr_f2;
68 hw->xfer_size = len;
69 hw->priv = !!(wq->type == IDXD_WQT_KERNEL);
70 hw->completion_addr = compl;
73
74 /*
75 * Descriptor completion vectors are 1-8 for MSIX. We will round
76 * robin through the 8 vectors.
77 */
78 wq->vec_ptr = (wq->vec_ptr % idxd->num_wq_irqs) + 1;
79 hw->int_handle = wq->vec_ptr;
80}
81
82static struct dma_async_tx_descriptor *
83idxd_dma_submit_memcpy(struct dma_chan *c, dma_addr_t dma_dest,
84 dma_addr_t dma_src, size_t len, unsigned long flags)
85{
86 struct idxd_wq *wq = to_idxd_wq(c);
87 u32 desc_flags;

--- 131 unchanged lines hidden ---
71}
72
73static struct dma_async_tx_descriptor *
74idxd_dma_submit_memcpy(struct dma_chan *c, dma_addr_t dma_dest,
75 dma_addr_t dma_src, size_t len, unsigned long flags)
76{
77 struct idxd_wq *wq = to_idxd_wq(c);
78 u32 desc_flags;

--- 131 unchanged lines hidden ---