The tcrypt module is used to test the crypto API by being passed a
mode=<value> during module load. The test runs to completion before
insmod/modprobe returns. That makes the RCU stall detection in newer
kernels unhappy.
The simple fix is to add CONFIG_PREEMPT to the kernel config. That's
what this patch does. If that introduces other problems,
crypto/tcrypt.c can be modified to call schedule() in the correct
places. Here's a patch that should work if this one has to be
reverted:
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index
66d254c..
b771f7d 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -33,6 +33,7 @@
#include <linux/jiffies.h>
#include <linux/timex.h>
#include <linux/interrupt.h>
+#include <linux/sched.h>
#include "tcrypt.h"
#include "internal.h"
@@ -182,6 +183,7 @@ static void test_cipher_speed(const char *algo, int enc, unsigned int sec,
goto out;
}
+ schedule();
printk("test %u (%d bit key, %d byte blocks): ", i,
*keysize * 8, *b_size);
@@ -448,6 +450,7 @@ static void test_hash_speed(const char *algo, unsigned int sec,
if (speed[i].klen)
crypto_hash_setkey(tfm, tvmem[0], speed[i].klen);
+ schedule();
printk(KERN_INFO "test%3u "
"(%5u byte blocks,%5u bytes per update,%4u updates): ",
i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);
@@ -688,12 +691,12 @@ static void test_ahash_speed(const char *algo, unsigned int sec,
break;
}
+ schedule();
pr_info("test%3u "
"(%5u byte blocks,%5u bytes per update,%4u updates): ",
i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);
ahash_request_set_crypt(req, sg, output, speed[i].plen);
-
if (sec)
ret = test_ahash_jiffies(req, speed[i].blen,
speed[i].plen, output, sec);
@@ -853,6 +856,7 @@ static void test_acipher_speed(const char *algo, int enc, unsigned int sec,
goto out_free_req;
}
+ schedule();
pr_info("test %u (%d bit key, %d byte blocks): ", i,
*keysize * 8, *b_size);
@@ -934,6 +938,7 @@ static void test_available(void)
printk("alg %s ", *name);
printk(crypto_has_alg(*name, 0, 0) ?
"found\n" : "not found\n");
+ schedule();
name++;
}
}
Signed-off-by: Jay Monkman <jay.monkman@freescale.com>
(cherry picked from commit
2dc1e6a900df2b575914a7c58fc08e4b072c0e67)