Commit 5f459f0a authored by Evgeniy Polyakov's avatar Evgeniy Polyakov Committed by Herbert Xu

crypto: hifn_795x - Use softirq kernel mapping in bh context

Use KM_SOFTIRQ instead of KM_IRQ in tasklet context.
Added bug_on on input no-page condition.
Signed-off-by: default avatarEvgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent d6a10c84
...@@ -1393,10 +1393,12 @@ static int hifn_setup_dma(struct hifn_device *dev, ...@@ -1393,10 +1393,12 @@ static int hifn_setup_dma(struct hifn_device *dev,
n = nbytes; n = nbytes;
while (n) { while (n) {
if (t->length && rctx->walk.flags & ASYNC_FLAGS_MISALIGNED) { if (t->length && rctx->walk.flags & ASYNC_FLAGS_MISALIGNED) {
BUG_ON(!sg_page(t));
dpage = sg_page(t); dpage = sg_page(t);
doff = 0; doff = 0;
len = t->length; len = t->length;
} else { } else {
BUG_ON(!sg_page(dst));
dpage = sg_page(dst); dpage = sg_page(dst);
doff = dst->offset; doff = dst->offset;
len = dst->length; len = dst->length;
...@@ -1791,17 +1793,17 @@ static void hifn_process_ready(struct ablkcipher_request *req, int error) ...@@ -1791,17 +1793,17 @@ static void hifn_process_ready(struct ablkcipher_request *req, int error)
continue; continue;
} }
saddr = kmap_atomic(sg_page(t), KM_IRQ1); saddr = kmap_atomic(sg_page(t), KM_SOFTIRQ0);
err = ablkcipher_get(saddr, &t->length, t->offset, err = ablkcipher_get(saddr, &t->length, t->offset,
dst, nbytes, &nbytes); dst, nbytes, &nbytes);
if (err < 0) { if (err < 0) {
kunmap_atomic(saddr, KM_IRQ1); kunmap_atomic(saddr, KM_SOFTIRQ0);
break; break;
} }
idx += err; idx += err;
kunmap_atomic(saddr, KM_IRQ1); kunmap_atomic(saddr, KM_SOFTIRQ0);
} }
ablkcipher_walk_exit(&rctx->walk); ablkcipher_walk_exit(&rctx->walk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment