Commit b3a37947 authored by David S. Miller's avatar David S. Miller

sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code.

We use the FPU and therefore cannot sleep during the crypto
loops.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ce688951
...@@ -100,6 +100,7 @@ static int __ecb_crypt(struct blkcipher_desc *desc, ...@@ -100,6 +100,7 @@ static int __ecb_crypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes); blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk); err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
if (encrypt) if (encrypt)
des_sparc64_load_keys(&ctx->encrypt_expkey[0]); des_sparc64_load_keys(&ctx->encrypt_expkey[0]);
...@@ -147,6 +148,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc, ...@@ -147,6 +148,7 @@ static int cbc_encrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes); blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk); err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
des_sparc64_load_keys(&ctx->encrypt_expkey[0]); des_sparc64_load_keys(&ctx->encrypt_expkey[0]);
while ((nbytes = walk.nbytes)) { while ((nbytes = walk.nbytes)) {
...@@ -177,6 +179,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc, ...@@ -177,6 +179,7 @@ static int cbc_decrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes); blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk); err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
des_sparc64_load_keys(&ctx->decrypt_expkey[0]); des_sparc64_load_keys(&ctx->decrypt_expkey[0]);
while ((nbytes = walk.nbytes)) { while ((nbytes = walk.nbytes)) {
...@@ -266,6 +269,7 @@ static int __ecb3_crypt(struct blkcipher_desc *desc, ...@@ -266,6 +269,7 @@ static int __ecb3_crypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes); blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk); err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
if (encrypt) if (encrypt)
K = &ctx->encrypt_expkey[0]; K = &ctx->encrypt_expkey[0];
...@@ -317,6 +321,7 @@ static int cbc3_encrypt(struct blkcipher_desc *desc, ...@@ -317,6 +321,7 @@ static int cbc3_encrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes); blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk); err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
K = &ctx->encrypt_expkey[0]; K = &ctx->encrypt_expkey[0];
des3_ede_sparc64_load_keys(K); des3_ede_sparc64_load_keys(K);
...@@ -352,6 +357,7 @@ static int cbc3_decrypt(struct blkcipher_desc *desc, ...@@ -352,6 +357,7 @@ static int cbc3_decrypt(struct blkcipher_desc *desc,
blkcipher_walk_init(&walk, dst, src, nbytes); blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk); err = blkcipher_walk_virt(desc, &walk);
desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
K = &ctx->decrypt_expkey[0]; K = &ctx->decrypt_expkey[0];
des3_ede_sparc64_load_keys(K); des3_ede_sparc64_load_keys(K);
......
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