summaryrefslogtreecommitdiff
path: root/drivers/crypto/marvell/tdma.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-28 04:51:36 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-28 04:51:36 +0300
commit2d706e790f0508dff4fb72eca9b4892b79757feb (patch)
tree1c79c1ec8880f5d6184d166d1f423956833724aa /drivers/crypto/marvell/tdma.c
parent8f18e4d03ed8fa5e4a300c94550533bd8ce4ff9a (diff)
parent8759fec4af222f338d08f8f1a7ad6a77ca6cb301 (diff)
downloadlinux-2d706e790f0508dff4fb72eca9b4892b79757feb.tar.xz
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu: "This fixes a hash corruption bug in the marvell driver" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: marvell - Copy IVDIG before launching partial DMA ahash requests
Diffstat (limited to 'drivers/crypto/marvell/tdma.c')
-rw-r--r--drivers/crypto/marvell/tdma.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/crypto/marvell/tdma.c b/drivers/crypto/marvell/tdma.c
index 4416b88eca70..c76375ff376d 100644
--- a/drivers/crypto/marvell/tdma.c
+++ b/drivers/crypto/marvell/tdma.c
@@ -109,7 +109,14 @@ void mv_cesa_tdma_chain(struct mv_cesa_engine *engine,
last->next = dreq->chain.first;
engine->chain.last = dreq->chain.last;
- if (!(last->flags & CESA_TDMA_BREAK_CHAIN))
+ /*
+ * Break the DMA chain if the CESA_TDMA_BREAK_CHAIN is set on
+ * the last element of the current chain, or if the request
+ * being queued needs the IV regs to be set before lauching
+ * the request.
+ */
+ if (!(last->flags & CESA_TDMA_BREAK_CHAIN) &&
+ !(dreq->chain.first->flags & CESA_TDMA_SET_STATE))
last->next_dma = dreq->chain.first->cur_dma;
}
}