Skip to content

Commit

Permalink
sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code.
Browse files Browse the repository at this point in the history
We use the FPU and therefore cannot sleep during the crypto
loops.

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Dec 19, 2012
1 parent b3a3794 commit 62ba63d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/sparc/crypto/camellia_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static int __ecb_crypt(struct blkcipher_desc *desc,

blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;

if (encrypt)
key = &ctx->encrypt_key[0];
Expand Down Expand Up @@ -160,6 +161,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc,

blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;

key = &ctx->encrypt_key[0];
camellia_sparc64_load_keys(key, ctx->key_len);
Expand Down Expand Up @@ -198,6 +200,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc,

blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;

key = &ctx->decrypt_key[0];
camellia_sparc64_load_keys(key, ctx->key_len);
Expand Down

0 comments on commit 62ba63d

Please sign in to comment.