diff options
author | Anup Patel <anup.patel@broadcom.com> | 2017-05-15 01:04:53 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2017-05-16 00:31:57 -0400 |
commit | baae03a0e2497f49704628fd0aaf993cf98e1b99 (patch) | |
tree | 103de8b8d9fd6b712a7cb4729660225541ad4269 | |
parent | b5dceda1f7ef66cba6f8d766502f242a27f96e6d (diff) |
async_tx: Fix DMA_PREP_FENCE usage in do_async_gen_syndrome()
The DMA_PREP_FENCE is to be used when preparing Tx descriptor if output
of Tx descriptor is to be used by next/dependent Tx descriptor.
The DMA_PREP_FENSE will not be set correctly in do_async_gen_syndrome()
when calling dma->device_prep_dma_pq() under following conditions:
1. ASYNC_TX_FENCE not set in submit->flags
2. DMA_PREP_FENCE not set in dma_flags
3. src_cnt (= (disks - 2)) is greater than dma_maxpq(dma, dma_flags)
This patch fixes DMA_PREP_FENCE usage in do_async_gen_syndrome() taking
inspiration from do_async_xor() implementation.
Signed-off-by: Anup Patel <anup.patel@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | crypto/async_tx/async_pq.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/async_tx/async_pq.c b/crypto/async_tx/async_pq.c index f83de99d7d71..56bd612927ab 100644 --- a/crypto/async_tx/async_pq.c +++ b/crypto/async_tx/async_pq.c | |||
@@ -62,9 +62,6 @@ do_async_gen_syndrome(struct dma_chan *chan, | |||
62 | dma_addr_t dma_dest[2]; | 62 | dma_addr_t dma_dest[2]; |
63 | int src_off = 0; | 63 | int src_off = 0; |
64 | 64 | ||
65 | if (submit->flags & ASYNC_TX_FENCE) | ||
66 | dma_flags |= DMA_PREP_FENCE; | ||
67 | |||
68 | while (src_cnt > 0) { | 65 | while (src_cnt > 0) { |
69 | submit->flags = flags_orig; | 66 | submit->flags = flags_orig; |
70 | pq_src_cnt = min(src_cnt, dma_maxpq(dma, dma_flags)); | 67 | pq_src_cnt = min(src_cnt, dma_maxpq(dma, dma_flags)); |
@@ -83,6 +80,8 @@ do_async_gen_syndrome(struct dma_chan *chan, | |||
83 | if (cb_fn_orig) | 80 | if (cb_fn_orig) |
84 | dma_flags |= DMA_PREP_INTERRUPT; | 81 | dma_flags |= DMA_PREP_INTERRUPT; |
85 | } | 82 | } |
83 | if (submit->flags & ASYNC_TX_FENCE) | ||
84 | dma_flags |= DMA_PREP_FENCE; | ||
86 | 85 | ||
87 | /* Drivers force forward progress in case they can not provide | 86 | /* Drivers force forward progress in case they can not provide |
88 | * a descriptor | 87 | * a descriptor |