summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/omap-sham.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/crypto/omap-sham.c')
-rw-r--r--drivers/crypto/omap-sham.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index 855898977d38..5c95bf97c132 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -137,6 +137,7 @@
137#define OMAP_ALIGNED __attribute__((aligned(sizeof(u32)))) 137#define OMAP_ALIGNED __attribute__((aligned(sizeof(u32))))
138 138
139#define BUFLEN PAGE_SIZE 139#define BUFLEN PAGE_SIZE
140#define OMAP_SHA_DMA_THRESHOLD 256
140 141
141struct omap_sham_dev; 142struct omap_sham_dev;
142 143
@@ -1435,10 +1436,11 @@ static int omap_sham_final(struct ahash_request *req)
1435 /* 1436 /*
1436 * OMAP HW accel works only with buffers >= 9. 1437 * OMAP HW accel works only with buffers >= 9.
1437 * HMAC is always >= 9 because ipad == block size. 1438 * HMAC is always >= 9 because ipad == block size.
1438 * If buffersize is less than 240, we use fallback SW encoding, 1439 * If buffersize is less than DMA_THRESHOLD, we use fallback
1439 * as using DMA + HW in this case doesn't provide any benefit. 1440 * SW encoding, as using DMA + HW in this case doesn't provide
1441 * any benefit.
1440 */ 1442 */
1441 if (!ctx->digcnt && ctx->bufcnt < 240) 1443 if (!ctx->digcnt && ctx->bufcnt < OMAP_SHA_DMA_THRESHOLD)
1442 return omap_sham_final_shash(req); 1444 return omap_sham_final_shash(req);
1443 else if (ctx->bufcnt) 1445 else if (ctx->bufcnt)
1444 return omap_sham_enqueue(req, OP_FINAL); 1446 return omap_sham_enqueue(req, OP_FINAL);