crypto: hifn_795x - Use softirq kernel mapping in bh context
authorEvgeniy Polyakov <zbr@ioremap.net>
Tue, 25 Nov 2008 15:17:10 +0000 (23:17 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 25 Dec 2008 00:02:00 +0000 (11:02 +1100)
Use KM_SOFTIRQ instead of KM_IRQ in tasklet context.
Added bug_on on input no-page condition.

Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hifn_795x.c

index ab4f94bec4ff074260c40a482dc1d7635630168d..0c79fe7f15673563257fe6a3a01a0c451f6dd997 100644 (file)
@@ -1393,10 +1393,12 @@ static int hifn_setup_dma(struct hifn_device *dev,
        n = nbytes;
        while (n) {
                if (t->length && rctx->walk.flags & ASYNC_FLAGS_MISALIGNED) {
+                       BUG_ON(!sg_page(t));
                        dpage = sg_page(t);
                        doff = 0;
                        len = t->length;
                } else {
+                       BUG_ON(!sg_page(dst));
                        dpage = sg_page(dst);
                        doff = dst->offset;
                        len = dst->length;
@@ -1791,17 +1793,17 @@ static void hifn_process_ready(struct ablkcipher_request *req, int error)
                                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,
                                        dst, nbytes, &nbytes);
                        if (err < 0) {
-                               kunmap_atomic(saddr, KM_IRQ1);
+                               kunmap_atomic(saddr, KM_SOFTIRQ0);
                                break;
                        }
 
                        idx += err;
-                       kunmap_atomic(saddr, KM_IRQ1);
+                       kunmap_atomic(saddr, KM_SOFTIRQ0);
                }
 
                ablkcipher_walk_exit(&rctx->walk);