crypto: api - Fix built-in testing dependency failures
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 17 Sep 2021 00:26:19 +0000 (08:26 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 24 Sep 2021 08:03:05 +0000 (16:03 +0800)
commitadad556efcdd42a1d9e060cbe5f6161cccf1fa28
tree5f23acffb6cbaf9a1d46feba04c13d1e407d197b
parent7c5329697ed4e0e1bf9a4e4fc9f0053f2f58935d
crypto: api - Fix built-in testing dependency failures

When complex algorithms that depend on other algorithms are built
into the kernel, the order of registration must be done such that
the underlying algorithms are ready before the ones on top are
registered.  As otherwise they would fail during the self-test
which is required during registration.

In the past we have used subsystem initialisation ordering to
guarantee this.  The number of such precedence levels are limited
and they may cause ripple effects in other subsystems.

This patch solves this problem by delaying all self-tests during
boot-up for built-in algorithms.  They will be tested either when
something else in the kernel requests for them, or when we have
finished registering all built-in algorithms, whichever comes
earlier.

Reported-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algapi.c
crypto/api.c
crypto/internal.h