Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[platform/kernel/linux-rpi.git] / drivers / crypto / marvell / hash.c
index 2a92605..317cf02 100644 (file)
@@ -168,12 +168,11 @@ static void mv_cesa_ahash_std_step(struct ahash_request *req)
        mv_cesa_adjust_op(engine, &creq->op_tmpl);
        memcpy_toio(engine->sram, &creq->op_tmpl, sizeof(creq->op_tmpl));
 
-       digsize = crypto_ahash_digestsize(crypto_ahash_reqtfm(req));
-       for (i = 0; i < digsize / 4; i++)
-               writel_relaxed(creq->state[i], engine->regs + CESA_IVDIG(i));
-
-       mv_cesa_adjust_op(engine, &creq->op_tmpl);
-       memcpy_toio(engine->sram, &creq->op_tmpl, sizeof(creq->op_tmpl));
+       if (!sreq->offset) {
+               digsize = crypto_ahash_digestsize(crypto_ahash_reqtfm(req));
+               for (i = 0; i < digsize / 4; i++)
+                       writel_relaxed(creq->state[i], engine->regs + CESA_IVDIG(i));
+       }
 
        if (creq->cache_ptr)
                memcpy_toio(engine->sram + CESA_SA_DATA_SRAM_OFFSET,