mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
Merge commit 'dmaengine-3.13-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/dmaengine
Pull dmaengine changes from Dan 1/ Bartlomiej and Dan finalized a rework of the dma address unmap implementation. 2/ In the course of testing 1/ a collection of enhancements to dmatest fell out. Notably basic performance statistics, and fixed / enhanced test control through new module parameters 'run', 'wait', 'noverify', and 'verbose'. Thanks to Andriy and Linus for their review. 3/ Testing the raid related corner cases of 1/ triggered bugs in the recently added 16-source operation support in the ioatdma driver. 4/ Some minor fixes / cleanups to mv_xor and ioatdma. Conflicts: drivers/dma/dmatest.c Signed-off-by: Vinod Koul <vinod.koul@intel.com>
This commit is contained in:
commit
df12a3178d
39 changed files with 1034 additions and 1927 deletions
|
@ -171,12 +171,6 @@ struct dma_interleaved_template {
|
|||
* @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client
|
||||
* acknowledges receipt, i.e. has has a chance to establish any dependency
|
||||
* chains
|
||||
* @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s)
|
||||
* @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s)
|
||||
* @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single
|
||||
* (if not set, do the source dma-unmapping as page)
|
||||
* @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single
|
||||
* (if not set, do the destination dma-unmapping as page)
|
||||
* @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q
|
||||
* @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P
|
||||
* @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as
|
||||
|
@ -188,14 +182,10 @@ struct dma_interleaved_template {
|
|||
enum dma_ctrl_flags {
|
||||
DMA_PREP_INTERRUPT = (1 << 0),
|
||||
DMA_CTRL_ACK = (1 << 1),
|
||||
DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2),
|
||||
DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3),
|
||||
DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4),
|
||||
DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5),
|
||||
DMA_PREP_PQ_DISABLE_P = (1 << 6),
|
||||
DMA_PREP_PQ_DISABLE_Q = (1 << 7),
|
||||
DMA_PREP_CONTINUE = (1 << 8),
|
||||
DMA_PREP_FENCE = (1 << 9),
|
||||
DMA_PREP_PQ_DISABLE_P = (1 << 2),
|
||||
DMA_PREP_PQ_DISABLE_Q = (1 << 3),
|
||||
DMA_PREP_CONTINUE = (1 << 4),
|
||||
DMA_PREP_FENCE = (1 << 5),
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -413,6 +403,17 @@ void dma_chan_cleanup(struct kref *kref);
|
|||
typedef bool (*dma_filter_fn)(struct dma_chan *chan, void *filter_param);
|
||||
|
||||
typedef void (*dma_async_tx_callback)(void *dma_async_param);
|
||||
|
||||
struct dmaengine_unmap_data {
|
||||
u8 to_cnt;
|
||||
u8 from_cnt;
|
||||
u8 bidi_cnt;
|
||||
struct device *dev;
|
||||
struct kref kref;
|
||||
size_t len;
|
||||
dma_addr_t addr[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dma_async_tx_descriptor - async transaction descriptor
|
||||
* ---dma generic offload fields---
|
||||
|
@ -438,6 +439,7 @@ struct dma_async_tx_descriptor {
|
|||
dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
|
||||
dma_async_tx_callback callback;
|
||||
void *callback_param;
|
||||
struct dmaengine_unmap_data *unmap;
|
||||
#ifdef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
|
||||
struct dma_async_tx_descriptor *next;
|
||||
struct dma_async_tx_descriptor *parent;
|
||||
|
@ -445,6 +447,40 @@ struct dma_async_tx_descriptor {
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_DMA_ENGINE
|
||||
static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx,
|
||||
struct dmaengine_unmap_data *unmap)
|
||||
{
|
||||
kref_get(&unmap->kref);
|
||||
tx->unmap = unmap;
|
||||
}
|
||||
|
||||
struct dmaengine_unmap_data *
|
||||
dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags);
|
||||
void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap);
|
||||
#else
|
||||
static inline void dma_set_unmap(struct dma_async_tx_descriptor *tx,
|
||||
struct dmaengine_unmap_data *unmap)
|
||||
{
|
||||
}
|
||||
static inline struct dmaengine_unmap_data *
|
||||
dmaengine_get_unmap_data(struct device *dev, int nr, gfp_t flags)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void dmaengine_unmap_put(struct dmaengine_unmap_data *unmap)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void dma_descriptor_unmap(struct dma_async_tx_descriptor *tx)
|
||||
{
|
||||
if (tx->unmap) {
|
||||
dmaengine_unmap_put(tx->unmap);
|
||||
tx->unmap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH
|
||||
static inline void txd_lock(struct dma_async_tx_descriptor *txd)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue