[PATCH] crypto: sun8i-ss - avoid hash and rng references

Herbert Xu herbert at gondor.apana.org.au
Tue May 5 02:24:01 PDT 2026


On Thu, Apr 23, 2026 at 08:55:42AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd at arndb.de>
> 
> While the sun4i-ss and sun8i-ce drivers started selecting CRYPTO_RNG,
> the sun8i-ss variant does not, and causes a link failure:
> 
> aarch64-linux-ld: drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.o: in function `sun8i_ss_unregister_algs':
> sun8i-ss-core.c:(.text.sun8i_ss_unregister_algs+0x94): undefined reference to `crypto_unregister_rng'
> aarch64-linux-ld: drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.o: in function `sun8i_ss_probe':
> sun8i-ss-core.c:(.text.sun8i_ss_probe+0x40c): undefined reference to `crypto_register_rng'
> 
> Looking more closely, I see that all of the allwinner crypto drivers have the
> same logic where the rng and hash parts of the driver are optional, but then the
> generic code is still selected, which is a bit inconsistent, aside from the
> missing CRYPTO_RNG select on sun8i-ss.
> 
> Change the approach so only the bits that are actually used are built, using
> ifdef checks around the optional portions that match the optional references
> to the sub-drivers.
> 
> Ideally the drivers would get reworked in a way that keeps all the bits
> related to the skcipher/ahash/rng codecs in the respective sub-drivers,
> rather than having a common driver that knows about all of these.
> 
> Fixes: cdadc1435937 ("crypto: cryptomgr - Select algorithm types only when CRYPTO_SELFTESTS")
> Signed-off-by: Arnd Bergmann <arnd at arndb.de>
> ---
> The simpler approach would be to add even more 'select' statements
> ---
>  drivers/crypto/allwinner/Kconfig                  |  2 --
>  drivers/crypto/allwinner/sun4i-ss/sun4i-ss-core.c |  8 ++++++++
>  drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c | 12 ++++++++++++
>  drivers/crypto/allwinner/sun8i-ss/sun8i-ss-core.c | 12 ++++++++++++
>  4 files changed, 32 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the linux-arm-kernel mailing list