aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/crypto/aes_glue.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-12-19 18:22:03 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-19 18:22:03 -0500
commitb35d282ef7345320b594d48d8d70caedfa962a01 (patch)
tree2f9ad1253bbabf3fe16aaac8639756d57297adba /arch/sparc/crypto/aes_glue.c
parenta8d97cef2168ffe5af1aeed6bf6cdc3ce53f3d0b (diff)
sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code.
We use the FPU and therefore cannot sleep during the crypto loops. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/crypto/aes_glue.c')
-rw-r--r--arch/sparc/crypto/aes_glue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c
index d26e75126fb5..503e6d96ad4e 100644
--- a/arch/sparc/crypto/aes_glue.c
+++ b/arch/sparc/crypto/aes_glue.c
@@ -222,6 +222,7 @@ static int ecb_encrypt(struct blkcipher_desc *desc,
222 222
223 blkcipher_walk_init(&walk, dst, src, nbytes); 223 blkcipher_walk_init(&walk, dst, src, nbytes);
224 err = blkcipher_walk_virt(desc, &walk); 224 err = blkcipher_walk_virt(desc, &walk);
225 desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
225 226
226 ctx->ops->load_encrypt_keys(&ctx->key[0]); 227 ctx->ops->load_encrypt_keys(&ctx->key[0]);
227 while ((nbytes = walk.nbytes)) { 228 while ((nbytes = walk.nbytes)) {
@@ -251,6 +252,7 @@ static int ecb_decrypt(struct blkcipher_desc *desc,
251 252
252 blkcipher_walk_init(&walk, dst, src, nbytes); 253 blkcipher_walk_init(&walk, dst, src, nbytes);
253 err = blkcipher_walk_virt(desc, &walk); 254 err = blkcipher_walk_virt(desc, &walk);
255 desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
254 256
255 ctx->ops->load_decrypt_keys(&ctx->key[0]); 257 ctx->ops->load_decrypt_keys(&ctx->key[0]);
256 key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)]; 258 key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
@@ -280,6 +282,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc,
280 282
281 blkcipher_walk_init(&walk, dst, src, nbytes); 283 blkcipher_walk_init(&walk, dst, src, nbytes);
282 err = blkcipher_walk_virt(desc, &walk); 284 err = blkcipher_walk_virt(desc, &walk);
285 desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
283 286
284 ctx->ops->load_encrypt_keys(&ctx->key[0]); 287 ctx->ops->load_encrypt_keys(&ctx->key[0]);
285 while ((nbytes = walk.nbytes)) { 288 while ((nbytes = walk.nbytes)) {
@@ -309,6 +312,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc,
309 312
310 blkcipher_walk_init(&walk, dst, src, nbytes); 313 blkcipher_walk_init(&walk, dst, src, nbytes);
311 err = blkcipher_walk_virt(desc, &walk); 314 err = blkcipher_walk_virt(desc, &walk);
315 desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
312 316
313 ctx->ops->load_decrypt_keys(&ctx->key[0]); 317 ctx->ops->load_decrypt_keys(&ctx->key[0]);
314 key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)]; 318 key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];