ltq-deu: init des/aes before registering crpyto algorithms

The crypto algorithms are registered and available to the system before
the chip is actually powered on and the generic parameter for the DEU
behaviour set.

The issue can mainly be observed if the crypto manager tests are enabled
in the kernel config. The crypto manager test run directly after an
algorithm is registered.

Signed-off-by: Mathias Kresin <dev@kresin.me>
[fix commit title prefix]
Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
This commit is contained in:
Mathias Kresin 2021-04-19 20:36:58 +02:00 committed by Hauke Mehrtens
parent 87b6e10c71
commit 11d2c71538
2 changed files with 2 additions and 3 deletions

View file

@ -894,6 +894,7 @@ int ifxdeu_init_aes (void)
{
int ret = -ENOSYS;
aes_chip_init();
if ((ret = crypto_register_alg(&ifxdeu_aes_alg)))
goto aes_err;
@ -910,8 +911,6 @@ int ifxdeu_init_aes (void)
if ((ret = crypto_register_alg(&ifxdeu_ctr_rfc3686_aes_alg)))
goto ctr_rfc3686_aes_err;
aes_chip_init ();
CRTCL_SECT_INIT;

View file

@ -690,6 +690,7 @@ int ifxdeu_init_des (void)
{
int ret = -ENOSYS;
des_chip_init();
ret = crypto_register_alg(&ifxdeu_des_alg);
if (ret < 0)
@ -715,7 +716,6 @@ int ifxdeu_init_des (void)
if (ret < 0)
goto cbc_des3_ede_err;
des_chip_init();
CRTCL_SECT_INIT;