aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-04-30 16:17:02 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 18:20:44 +0800
commitef93f1562803cd7bb8159e3abedaf7f47dce4e35 (patch)
treee6155c94c5aeffe795cf5bf69b2001f615f1cf19
parent89490e6b80c53bf7783fe183a2fda8d0944f52d2 (diff)
Revert "crypto: run initcalls for generic implementations earlier"
This reverts commit c4741b23059794bd99beef0f700103b0d983b3fd. Crypto API self-tests no longer run at registration time and now occur either at late_initcall or upon the first use. Therefore the premise of the above commit no longer exists. Revert it and subsequent additions of subsys_initcall and arch_initcall. Note that lib/crypto calls will stay at subsys_initcall (or rather downgraded from arch_initcall) because they may need to occur before Crypto API registration. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--arch/arm/crypto/aes-neonbs-glue.c2
-rw-r--r--arch/arm/lib/crypto/chacha-glue.c2
-rw-r--r--arch/arm/lib/crypto/poly1305-glue.c2
-rw-r--r--arch/arm/lib/crypto/sha256.c2
-rw-r--r--arch/arm64/lib/crypto/chacha-neon-glue.c2
-rw-r--r--arch/arm64/lib/crypto/poly1305-glue.c2
-rw-r--r--arch/arm64/lib/crypto/sha256.c2
-rw-r--r--arch/powerpc/lib/crypto/chacha-p10-glue.c2
-rw-r--r--arch/powerpc/lib/crypto/poly1305-p10-glue.c2
-rw-r--r--arch/riscv/lib/crypto/chacha-riscv64-glue.c2
-rw-r--r--arch/riscv/lib/crypto/sha256.c2
-rw-r--r--arch/s390/lib/crypto/sha256.c2
-rw-r--r--arch/sparc/lib/crypto/sha256.c2
-rw-r--r--arch/x86/lib/crypto/chacha_glue.c2
-rw-r--r--arch/x86/lib/crypto/poly1305_glue.c2
-rw-r--r--arch/x86/lib/crypto/sha256.c2
-rw-r--r--crypto/842.c2
-rw-r--r--crypto/adiantum.c2
-rw-r--r--crypto/aegis128-core.c2
-rw-r--r--crypto/aes_generic.c2
-rw-r--r--crypto/algboss.c8
-rw-r--r--crypto/ansi_cprng.c2
-rw-r--r--crypto/anubis.c2
-rw-r--r--crypto/arc4.c2
-rw-r--r--crypto/aria_generic.c2
-rw-r--r--crypto/authenc.c2
-rw-r--r--crypto/authencesn.c2
-rw-r--r--crypto/blake2b_generic.c2
-rw-r--r--crypto/blowfish_generic.c2
-rw-r--r--crypto/camellia_generic.c2
-rw-r--r--crypto/cast5_generic.c2
-rw-r--r--crypto/cast6_generic.c2
-rw-r--r--crypto/cbc.c2
-rw-r--r--crypto/ccm.c2
-rw-r--r--crypto/chacha.c2
-rw-r--r--crypto/chacha20poly1305.c2
-rw-r--r--crypto/cmac.c2
-rw-r--r--crypto/crc32_generic.c2
-rw-r--r--crypto/crc32c_generic.c2
-rw-r--r--crypto/cryptd.c2
-rw-r--r--crypto/crypto_null.c2
-rw-r--r--crypto/ctr.c2
-rw-r--r--crypto/cts.c2
-rw-r--r--crypto/curve25519-generic.c2
-rw-r--r--crypto/deflate.c2
-rw-r--r--crypto/des_generic.c2
-rw-r--r--crypto/dh.c2
-rw-r--r--crypto/drbg.c2
-rw-r--r--crypto/ecb.c2
-rw-r--r--crypto/ecdh.c2
-rw-r--r--crypto/ecdsa.c2
-rw-r--r--crypto/echainiv.c2
-rw-r--r--crypto/essiv.c2
-rw-r--r--crypto/fcrypt.c2
-rw-r--r--crypto/fips.c2
-rw-r--r--crypto/gcm.c2
-rw-r--r--crypto/ghash-generic.c2
-rw-r--r--crypto/hctr2.c2
-rw-r--r--crypto/hmac.c2
-rw-r--r--crypto/khazad.c2
-rw-r--r--crypto/krb5enc.c2
-rw-r--r--crypto/lrw.c2
-rw-r--r--crypto/lz4.c2
-rw-r--r--crypto/lz4hc.c2
-rw-r--r--crypto/lzo-rle.c2
-rw-r--r--crypto/lzo.c2
-rw-r--r--crypto/md4.c2
-rw-r--r--crypto/md5.c2
-rw-r--r--crypto/michael_mic.c2
-rw-r--r--crypto/nhpoly1305.c2
-rw-r--r--crypto/pcbc.c2
-rw-r--r--crypto/pcrypt.c2
-rw-r--r--crypto/polyval-generic.c2
-rw-r--r--crypto/rmd160.c2
-rw-r--r--crypto/rsa.c2
-rw-r--r--crypto/seed.c2
-rw-r--r--crypto/seqiv.c2
-rw-r--r--crypto/serpent_generic.c2
-rw-r--r--crypto/sha1_generic.c2
-rw-r--r--crypto/sha256.c2
-rw-r--r--crypto/sha512_generic.c2
-rw-r--r--crypto/sm3_generic.c2
-rw-r--r--crypto/sm4_generic.c2
-rw-r--r--crypto/streebog_generic.c2
-rw-r--r--crypto/tea.c2
-rw-r--r--crypto/twofish_generic.c2
-rw-r--r--crypto/wp512.c2
-rw-r--r--crypto/xcbc.c2
-rw-r--r--crypto/xctr.c2
-rw-r--r--crypto/xts.c2
-rw-r--r--crypto/xxhash_generic.c2
-rw-r--r--crypto/zstd.c2
92 files changed, 92 insertions, 98 deletions
diff --git a/arch/arm/crypto/aes-neonbs-glue.c b/arch/arm/crypto/aes-neonbs-glue.c
index 95418df97fb4..c60104dc1585 100644
--- a/arch/arm/crypto/aes-neonbs-glue.c
+++ b/arch/arm/crypto/aes-neonbs-glue.c
@@ -407,5 +407,5 @@ static int __init aes_init(void)
return crypto_register_skciphers(aes_algs, ARRAY_SIZE(aes_algs));
}
-late_initcall(aes_init);
+module_init(aes_init);
module_exit(aes_exit);
diff --git a/arch/arm/lib/crypto/chacha-glue.c b/arch/arm/lib/crypto/chacha-glue.c
index 12afb40cf1ff..1e28736834a0 100644
--- a/arch/arm/lib/crypto/chacha-glue.c
+++ b/arch/arm/lib/crypto/chacha-glue.c
@@ -122,7 +122,7 @@ static int __init chacha_arm_mod_init(void)
}
return 0;
}
-arch_initcall(chacha_arm_mod_init);
+subsys_initcall(chacha_arm_mod_init);
static void __exit chacha_arm_mod_exit(void)
{
diff --git a/arch/arm/lib/crypto/poly1305-glue.c b/arch/arm/lib/crypto/poly1305-glue.c
index 91da42b26d9c..2603b0771f2c 100644
--- a/arch/arm/lib/crypto/poly1305-glue.c
+++ b/arch/arm/lib/crypto/poly1305-glue.c
@@ -69,7 +69,7 @@ static int __init arm_poly1305_mod_init(void)
static_branch_enable(&have_neon);
return 0;
}
-arch_initcall(arm_poly1305_mod_init);
+subsys_initcall(arm_poly1305_mod_init);
static void __exit arm_poly1305_mod_exit(void)
{
diff --git a/arch/arm/lib/crypto/sha256.c b/arch/arm/lib/crypto/sha256.c
index 3a8dfc304807..81612b7b9043 100644
--- a/arch/arm/lib/crypto/sha256.c
+++ b/arch/arm/lib/crypto/sha256.c
@@ -53,7 +53,7 @@ static int __init sha256_arm_mod_init(void)
}
return 0;
}
-arch_initcall(sha256_arm_mod_init);
+subsys_initcall(sha256_arm_mod_init);
static void __exit sha256_arm_mod_exit(void)
{
diff --git a/arch/arm64/lib/crypto/chacha-neon-glue.c b/arch/arm64/lib/crypto/chacha-neon-glue.c
index 14a2836eff61..2b0de97a6daf 100644
--- a/arch/arm64/lib/crypto/chacha-neon-glue.c
+++ b/arch/arm64/lib/crypto/chacha-neon-glue.c
@@ -104,7 +104,7 @@ static int __init chacha_simd_mod_init(void)
static_branch_enable(&have_neon);
return 0;
}
-arch_initcall(chacha_simd_mod_init);
+subsys_initcall(chacha_simd_mod_init);
static void __exit chacha_simd_mod_exit(void)
{
diff --git a/arch/arm64/lib/crypto/poly1305-glue.c b/arch/arm64/lib/crypto/poly1305-glue.c
index 681c26557336..6a661cf04821 100644
--- a/arch/arm64/lib/crypto/poly1305-glue.c
+++ b/arch/arm64/lib/crypto/poly1305-glue.c
@@ -62,7 +62,7 @@ static int __init neon_poly1305_mod_init(void)
static_branch_enable(&have_neon);
return 0;
}
-arch_initcall(neon_poly1305_mod_init);
+subsys_initcall(neon_poly1305_mod_init);
static void __exit neon_poly1305_mod_exit(void)
{
diff --git a/arch/arm64/lib/crypto/sha256.c b/arch/arm64/lib/crypto/sha256.c
index 2bd413c586d2..354fc402c6d3 100644
--- a/arch/arm64/lib/crypto/sha256.c
+++ b/arch/arm64/lib/crypto/sha256.c
@@ -64,7 +64,7 @@ static int __init sha256_arm64_mod_init(void)
}
return 0;
}
-arch_initcall(sha256_arm64_mod_init);
+subsys_initcall(sha256_arm64_mod_init);
static void __exit sha256_arm64_mod_exit(void)
{
diff --git a/arch/powerpc/lib/crypto/chacha-p10-glue.c b/arch/powerpc/lib/crypto/chacha-p10-glue.c
index 351ed409f9b2..51daeaf5d26e 100644
--- a/arch/powerpc/lib/crypto/chacha-p10-glue.c
+++ b/arch/powerpc/lib/crypto/chacha-p10-glue.c
@@ -87,7 +87,7 @@ static int __init chacha_p10_init(void)
static_branch_enable(&have_p10);
return 0;
}
-arch_initcall(chacha_p10_init);
+subsys_initcall(chacha_p10_init);
static void __exit chacha_p10_exit(void)
{
diff --git a/arch/powerpc/lib/crypto/poly1305-p10-glue.c b/arch/powerpc/lib/crypto/poly1305-p10-glue.c
index 50ac802220e0..16c2a8316696 100644
--- a/arch/powerpc/lib/crypto/poly1305-p10-glue.c
+++ b/arch/powerpc/lib/crypto/poly1305-p10-glue.c
@@ -76,7 +76,7 @@ static int __init poly1305_p10_init(void)
static_branch_enable(&have_p10);
return 0;
}
-arch_initcall(poly1305_p10_init);
+subsys_initcall(poly1305_p10_init);
static void __exit poly1305_p10_exit(void)
{
diff --git a/arch/riscv/lib/crypto/chacha-riscv64-glue.c b/arch/riscv/lib/crypto/chacha-riscv64-glue.c
index afc4e3be3cac..1740e1ca3a94 100644
--- a/arch/riscv/lib/crypto/chacha-riscv64-glue.c
+++ b/arch/riscv/lib/crypto/chacha-riscv64-glue.c
@@ -62,7 +62,7 @@ static int __init riscv64_chacha_mod_init(void)
static_branch_enable(&use_zvkb);
return 0;
}
-arch_initcall(riscv64_chacha_mod_init);
+subsys_initcall(riscv64_chacha_mod_init);
static void __exit riscv64_chacha_mod_exit(void)
{
diff --git a/arch/riscv/lib/crypto/sha256.c b/arch/riscv/lib/crypto/sha256.c
index 18b84030f0b3..c8065c70337b 100644
--- a/arch/riscv/lib/crypto/sha256.c
+++ b/arch/riscv/lib/crypto/sha256.c
@@ -50,7 +50,7 @@ static int __init riscv64_sha256_mod_init(void)
static_branch_enable(&have_extensions);
return 0;
}
-arch_initcall(riscv64_sha256_mod_init);
+subsys_initcall(riscv64_sha256_mod_init);
static void __exit riscv64_sha256_mod_exit(void)
{
diff --git a/arch/s390/lib/crypto/sha256.c b/arch/s390/lib/crypto/sha256.c
index 50c592ce7a5d..f1d73ea1eef6 100644
--- a/arch/s390/lib/crypto/sha256.c
+++ b/arch/s390/lib/crypto/sha256.c
@@ -36,7 +36,7 @@ static int __init sha256_s390_mod_init(void)
static_branch_enable(&have_cpacf_sha256);
return 0;
}
-arch_initcall(sha256_s390_mod_init);
+subsys_initcall(sha256_s390_mod_init);
static void __exit sha256_s390_mod_exit(void)
{
diff --git a/arch/sparc/lib/crypto/sha256.c b/arch/sparc/lib/crypto/sha256.c
index 6f118a23d210..0394c2b72f9e 100644
--- a/arch/sparc/lib/crypto/sha256.c
+++ b/arch/sparc/lib/crypto/sha256.c
@@ -53,7 +53,7 @@ static int __init sha256_sparc64_mod_init(void)
pr_info("Using sparc64 sha256 opcode optimized SHA-256/SHA-224 implementation\n");
return 0;
}
-arch_initcall(sha256_sparc64_mod_init);
+subsys_initcall(sha256_sparc64_mod_init);
static void __exit sha256_sparc64_mod_exit(void)
{
diff --git a/arch/x86/lib/crypto/chacha_glue.c b/arch/x86/lib/crypto/chacha_glue.c
index 59bf63c00072..94fcefbc8827 100644
--- a/arch/x86/lib/crypto/chacha_glue.c
+++ b/arch/x86/lib/crypto/chacha_glue.c
@@ -174,7 +174,7 @@ static int __init chacha_simd_mod_init(void)
}
return 0;
}
-arch_initcall(chacha_simd_mod_init);
+subsys_initcall(chacha_simd_mod_init);
static void __exit chacha_simd_mod_exit(void)
{
diff --git a/arch/x86/lib/crypto/poly1305_glue.c b/arch/x86/lib/crypto/poly1305_glue.c
index f799828c5809..b7e78a583e07 100644
--- a/arch/x86/lib/crypto/poly1305_glue.c
+++ b/arch/x86/lib/crypto/poly1305_glue.c
@@ -117,7 +117,7 @@ static int __init poly1305_simd_mod_init(void)
static_branch_enable(&poly1305_use_avx512);
return 0;
}
-arch_initcall(poly1305_simd_mod_init);
+subsys_initcall(poly1305_simd_mod_init);
static void __exit poly1305_simd_mod_exit(void)
{
diff --git a/arch/x86/lib/crypto/sha256.c b/arch/x86/lib/crypto/sha256.c
index 47865b5cd94b..ea17514cb0f3 100644
--- a/arch/x86/lib/crypto/sha256.c
+++ b/arch/x86/lib/crypto/sha256.c
@@ -63,7 +63,7 @@ static int __init sha256_x86_mod_init(void)
static_branch_enable(&have_sha256_x86);
return 0;
}
-arch_initcall(sha256_x86_mod_init);
+subsys_initcall(sha256_x86_mod_init);
static void __exit sha256_x86_mod_exit(void)
{
diff --git a/crypto/842.c b/crypto/842.c
index 881945d44328..8c257c40e2b9 100644
--- a/crypto/842.c
+++ b/crypto/842.c
@@ -70,7 +70,7 @@ static int __init crypto842_mod_init(void)
{
return crypto_register_scomp(&scomp);
}
-subsys_initcall(crypto842_mod_init);
+module_init(crypto842_mod_init);
static void __exit crypto842_mod_exit(void)
{
diff --git a/crypto/adiantum.c b/crypto/adiantum.c
index c3ef583598b4..a6bca877c3c7 100644
--- a/crypto/adiantum.c
+++ b/crypto/adiantum.c
@@ -639,7 +639,7 @@ static void __exit adiantum_module_exit(void)
crypto_unregister_template(&adiantum_tmpl);
}
-subsys_initcall(adiantum_module_init);
+module_init(adiantum_module_init);
module_exit(adiantum_module_exit);
MODULE_DESCRIPTION("Adiantum length-preserving encryption mode");
diff --git a/crypto/aegis128-core.c b/crypto/aegis128-core.c
index 72f6ee1345ef..ca80d861345d 100644
--- a/crypto/aegis128-core.c
+++ b/crypto/aegis128-core.c
@@ -566,7 +566,7 @@ static void __exit crypto_aegis128_module_exit(void)
crypto_unregister_aead(&crypto_aegis128_alg_generic);
}
-subsys_initcall(crypto_aegis128_module_init);
+module_init(crypto_aegis128_module_init);
module_exit(crypto_aegis128_module_exit);
MODULE_LICENSE("GPL");
diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c
index 3c66d425c97b..85d2e78c8ef2 100644
--- a/crypto/aes_generic.c
+++ b/crypto/aes_generic.c
@@ -1311,7 +1311,7 @@ static void __exit aes_fini(void)
crypto_unregister_alg(&aes_alg);
}
-subsys_initcall(aes_init);
+module_init(aes_init);
module_exit(aes_fini);
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
diff --git a/crypto/algboss.c b/crypto/algboss.c
index a20926bfd34e..ef5c73780fc7 100644
--- a/crypto/algboss.c
+++ b/crypto/algboss.c
@@ -247,13 +247,7 @@ static void __exit cryptomgr_exit(void)
BUG_ON(err);
}
-/*
- * This is arch_initcall() so that the crypto self-tests are run on algorithms
- * registered early by subsys_initcall(). subsys_initcall() is needed for
- * generic implementations so that they're available for comparison tests when
- * other implementations are registered later by module_init().
- */
-arch_initcall(cryptomgr_init);
+module_init(cryptomgr_init);
module_exit(cryptomgr_exit);
MODULE_LICENSE("GPL");
diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c
index 64f57c4c4b06..153523ce6076 100644
--- a/crypto/ansi_cprng.c
+++ b/crypto/ansi_cprng.c
@@ -467,7 +467,7 @@ MODULE_DESCRIPTION("Software Pseudo Random Number Generator");
MODULE_AUTHOR("Neil Horman <nhorman@tuxdriver.com>");
module_param(dbg, int, 0);
MODULE_PARM_DESC(dbg, "Boolean to enable debugging (0/1 == off/on)");
-subsys_initcall(prng_mod_init);
+module_init(prng_mod_init);
module_exit(prng_mod_fini);
MODULE_ALIAS_CRYPTO("stdrng");
MODULE_ALIAS_CRYPTO("ansi_cprng");
diff --git a/crypto/anubis.c b/crypto/anubis.c
index 886e7c913688..4268c3833baa 100644
--- a/crypto/anubis.c
+++ b/crypto/anubis.c
@@ -694,7 +694,7 @@ static void __exit anubis_mod_fini(void)
crypto_unregister_alg(&anubis_alg);
}
-subsys_initcall(anubis_mod_init);
+module_init(anubis_mod_init);
module_exit(anubis_mod_fini);
MODULE_LICENSE("GPL");
diff --git a/crypto/arc4.c b/crypto/arc4.c
index 1a4825c97c5a..1608018111d0 100644
--- a/crypto/arc4.c
+++ b/crypto/arc4.c
@@ -73,7 +73,7 @@ static void __exit arc4_exit(void)
crypto_unregister_lskcipher(&arc4_alg);
}
-subsys_initcall(arc4_init);
+module_init(arc4_init);
module_exit(arc4_exit);
MODULE_LICENSE("GPL");
diff --git a/crypto/aria_