Commit e63e1b0d authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

crypto: testmgr - add some more preemption points

Call cond_resched() after each fuzz test iteration.  This avoids stall
warnings if fuzz_iterations is set very high for testing purposes.

While we're at it, also call cond_resched() after finishing testing each
test vector.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 177f87d0
...@@ -1496,6 +1496,7 @@ static int test_hash_vec(const char *driver, const struct hash_testvec *vec, ...@@ -1496,6 +1496,7 @@ static int test_hash_vec(const char *driver, const struct hash_testvec *vec,
req, desc, tsgl, hashstate); req, desc, tsgl, hashstate);
if (err) if (err)
return err; return err;
cond_resched();
} }
} }
#endif #endif
...@@ -1764,6 +1765,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs, ...@@ -1764,6 +1765,7 @@ static int __alg_test_hash(const struct hash_testvec *vecs,
hashstate); hashstate);
if (err) if (err)
goto out; goto out;
cond_resched();
} }
err = test_hash_vs_generic_impl(driver, generic_driver, maxkeysize, req, err = test_hash_vs_generic_impl(driver, generic_driver, maxkeysize, req,
desc, tsgl, hashstate); desc, tsgl, hashstate);
...@@ -2028,6 +2030,7 @@ static int test_aead_vec(const char *driver, int enc, ...@@ -2028,6 +2030,7 @@ static int test_aead_vec(const char *driver, int enc,
&cfg, req, tsgls); &cfg, req, tsgls);
if (err) if (err)
return err; return err;
cond_resched();
} }
} }
#endif #endif
...@@ -2267,6 +2270,7 @@ static int test_aead(const char *driver, int enc, ...@@ -2267,6 +2270,7 @@ static int test_aead(const char *driver, int enc,
tsgls); tsgls);
if (err) if (err)
return err; return err;
cond_resched();
} }
return 0; return 0;
} }
...@@ -2609,6 +2613,7 @@ static int test_skcipher_vec(const char *driver, int enc, ...@@ -2609,6 +2613,7 @@ static int test_skcipher_vec(const char *driver, int enc,
&cfg, req, tsgls); &cfg, req, tsgls);
if (err) if (err)
return err; return err;
cond_resched();
} }
} }
#endif #endif
...@@ -2808,6 +2813,7 @@ static int test_skcipher(const char *driver, int enc, ...@@ -2808,6 +2813,7 @@ static int test_skcipher(const char *driver, int enc,
tsgls); tsgls);
if (err) if (err)
return err; return err;
cond_resched();
} }
return 0; return 0;
} }
......
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