diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:42:50 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:42:50 -0400 |
commit | 0403e3827788d878163f9ef0541b748b0f88ca5d (patch) | |
tree | 2dc73744bd92c268a1310f24668167f130877278 /include/linux | |
parent | f9dd2134374c8de6b911e2b8652c6c9622eaa658 (diff) |
dmaengine: add fence support
Some engines optimize operation by reading ahead in the descriptor chain
such that descriptor2 may start execution before descriptor1 completes.
If descriptor2 depends on the result from descriptor1 then a fence is
required (on descriptor2) to disable this optimization. The async_tx
api could implicitly identify dependencies via the 'depend_tx'
parameter, but that would constrain cases where the dependency chain
only specifies a completion order rather than a data dependency. So,
provide an ASYNC_TX_FENCE to explicitly identify data dependencies.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/async_tx.h | 3 | ||||
-rw-r--r-- | include/linux/dmaengine.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h index 866e61c4e2e0..a1c486a88e88 100644 --- a/include/linux/async_tx.h +++ b/include/linux/async_tx.h | |||
@@ -58,11 +58,14 @@ struct dma_chan_ref { | |||
58 | * array. | 58 | * array. |
59 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a | 59 | * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a |
60 | * dependency chain | 60 | * dependency chain |
61 | * @ASYNC_TX_FENCE: specify that the next operation in the dependency | ||
62 | * chain uses this operation's result as an input | ||
61 | */ | 63 | */ |
62 | enum async_tx_flags { | 64 | enum async_tx_flags { |
63 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), | 65 | ASYNC_TX_XOR_ZERO_DST = (1 << 0), |
64 | ASYNC_TX_XOR_DROP_DST = (1 << 1), | 66 | ASYNC_TX_XOR_DROP_DST = (1 << 1), |
65 | ASYNC_TX_ACK = (1 << 2), | 67 | ASYNC_TX_ACK = (1 << 2), |
68 | ASYNC_TX_FENCE = (1 << 3), | ||
66 | }; | 69 | }; |
67 | 70 | ||
68 | /** | 71 | /** |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 1012f1abcb54..4d6c1c925fd4 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -87,6 +87,8 @@ enum dma_transaction_type { | |||
87 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as | 87 | * @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as |
88 | * sources that were the result of a previous operation, in the case of a PQ | 88 | * sources that were the result of a previous operation, in the case of a PQ |
89 | * operation it continues the calculation with new sources | 89 | * operation it continues the calculation with new sources |
90 | * @DMA_PREP_FENCE - tell the driver that subsequent operations depend | ||
91 | * on the result of this operation | ||
90 | */ | 92 | */ |
91 | enum dma_ctrl_flags { | 93 | enum dma_ctrl_flags { |
92 | DMA_PREP_INTERRUPT = (1 << 0), | 94 | DMA_PREP_INTERRUPT = (1 << 0), |
@@ -98,6 +100,7 @@ enum dma_ctrl_flags { | |||
98 | DMA_PREP_PQ_DISABLE_P = (1 << 6), | 100 | DMA_PREP_PQ_DISABLE_P = (1 << 6), |
99 | DMA_PREP_PQ_DISABLE_Q = (1 << 7), | 101 | DMA_PREP_PQ_DISABLE_Q = (1 << 7), |
100 | DMA_PREP_CONTINUE = (1 << 8), | 102 | DMA_PREP_CONTINUE = (1 << 8), |
103 | DMA_PREP_FENCE = (1 << 9), | ||
101 | }; | 104 | }; |
102 | 105 | ||
103 | /** | 106 | /** |