Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: qce - fix priority to be less than ARMv8 CE

As QCE is an order of magnitude slower than the ARMv8 Crypto Extensions
on the CPU, and is also less well tested, give it a lower priority.
Previously the QCE SHA algorithms had higher priority than the ARMv8 CE
equivalents, and the ciphers such as AES-XTS had the same priority which
meant the QCE versions were chosen if they happened to be loaded later.

Fixes: ec8f5d8f6f76 ("crypto: qce - Qualcomm crypto engine driver")
Cc: stable@vger.kernel.org
Cc: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Thara Gopinath <thara.gopinath@gmail.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
49b9258b f1e532d0

+3 -3
+1 -1
drivers/crypto/qce/aead.c
··· 786 786 alg->init = qce_aead_init; 787 787 alg->exit = qce_aead_exit; 788 788 789 - alg->base.cra_priority = 300; 789 + alg->base.cra_priority = 275; 790 790 alg->base.cra_flags = CRYPTO_ALG_ASYNC | 791 791 CRYPTO_ALG_ALLOCATES_MEMORY | 792 792 CRYPTO_ALG_KERN_DRIVER_ONLY |
+1 -1
drivers/crypto/qce/sha.c
··· 482 482 483 483 base = &alg->halg.base; 484 484 base->cra_blocksize = def->blocksize; 485 - base->cra_priority = 300; 485 + base->cra_priority = 175; 486 486 base->cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY; 487 487 base->cra_ctxsize = sizeof(struct qce_sha_ctx); 488 488 base->cra_alignmask = 0;
+1 -1
drivers/crypto/qce/skcipher.c
··· 461 461 alg->encrypt = qce_skcipher_encrypt; 462 462 alg->decrypt = qce_skcipher_decrypt; 463 463 464 - alg->base.cra_priority = 300; 464 + alg->base.cra_priority = 275; 465 465 alg->base.cra_flags = CRYPTO_ALG_ASYNC | 466 466 CRYPTO_ALG_ALLOCATES_MEMORY | 467 467 CRYPTO_ALG_KERN_DRIVER_ONLY;