* [PATCH] hwrng: nomadik: add ARM_AMBA dependency
@ 2025-07-29 15:28 Arnd Bergmann
2025-08-16 9:34 ` Herbert Xu
2025-10-06 8:23 ` Geert Uytterhoeven
0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-07-29 15:28 UTC (permalink / raw)
To: Olivia Mackall, Herbert Xu, Cai Huoqing
Cc: Arnd Bergmann, Dragan Simic, Francesco Dolcini, Daniel Golle,
Geert Uytterhoeven, Christian Marangi, Aurelien Jarno,
Markus Mayer, Lukas Bulwahn, Nicolas Frattaroli, linux-crypto,
linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Compile-testing this driver is only possible when the AMBA bus driver is
available in the kernel:
x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_remove':
nomadik-rng.c:(.text+0x67): undefined reference to `amba_release_regions'
x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_probe':
nomadik-rng.c:(.text+0xee): undefined reference to `amba_request_regions'
x86_64-linux-ld: nomadik-rng.c:(.text+0x18d): undefined reference to `amba_release_regions'
The was previously implied by the 'depends on ARCH_NOMADIK', but needs to be
specified for the COMPILE_TEST case.
Fixes: d5e93b3374e4 ("hwrng: Kconfig - Add helper dependency on COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/char/hw_random/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 3227dcaa9111..aef4406973f3 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -312,6 +312,7 @@ config HW_RANDOM_INGENIC_TRNG
config HW_RANDOM_NOMADIK
tristate "ST-Ericsson Nomadik Random Number Generator support"
depends on ARCH_NOMADIK || COMPILE_TEST
+ depends on ARM_AMBA
default HW_RANDOM
help
This driver provides kernel-side support for the Random Number
--
2.39.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] hwrng: nomadik: add ARM_AMBA dependency
2025-07-29 15:28 [PATCH] hwrng: nomadik: add ARM_AMBA dependency Arnd Bergmann
@ 2025-08-16 9:34 ` Herbert Xu
2025-10-06 8:23 ` Geert Uytterhoeven
1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2025-08-16 9:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Olivia Mackall, Cai Huoqing, Arnd Bergmann, Dragan Simic,
Francesco Dolcini, Daniel Golle, Geert Uytterhoeven,
Christian Marangi, Aurelien Jarno, Markus Mayer, Lukas Bulwahn,
Nicolas Frattaroli, linux-crypto, linux-kernel
On Tue, Jul 29, 2025 at 05:28:00PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compile-testing this driver is only possible when the AMBA bus driver is
> available in the kernel:
>
> x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_remove':
> nomadik-rng.c:(.text+0x67): undefined reference to `amba_release_regions'
> x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_probe':
> nomadik-rng.c:(.text+0xee): undefined reference to `amba_request_regions'
> x86_64-linux-ld: nomadik-rng.c:(.text+0x18d): undefined reference to `amba_release_regions'
>
> The was previously implied by the 'depends on ARCH_NOMADIK', but needs to be
> specified for the COMPILE_TEST case.
>
> Fixes: d5e93b3374e4 ("hwrng: Kconfig - Add helper dependency on COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/char/hw_random/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hwrng: nomadik: add ARM_AMBA dependency
2025-07-29 15:28 [PATCH] hwrng: nomadik: add ARM_AMBA dependency Arnd Bergmann
2025-08-16 9:34 ` Herbert Xu
@ 2025-10-06 8:23 ` Geert Uytterhoeven
2025-10-06 9:06 ` Arnd Bergmann
1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2025-10-06 8:23 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Olivia Mackall, Herbert Xu, Cai Huoqing, Arnd Bergmann,
Dragan Simic, Francesco Dolcini, Daniel Golle, Christian Marangi,
Aurelien Jarno, Markus Mayer, Lukas Bulwahn, Nicolas Frattaroli,
linux-crypto, linux-kernel
Hi Arnd,
On Tue, 29 Jul 2025 at 17:28, Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Compile-testing this driver is only possible when the AMBA bus driver is
> available in the kernel:
>
> x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_remove':
> nomadik-rng.c:(.text+0x67): undefined reference to `amba_release_regions'
> x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_probe':
> nomadik-rng.c:(.text+0xee): undefined reference to `amba_request_regions'
> x86_64-linux-ld: nomadik-rng.c:(.text+0x18d): undefined reference to `amba_release_regions'
>
> The was previously implied by the 'depends on ARCH_NOMADIK', but needs to be
> specified for the COMPILE_TEST case.
>
> Fixes: d5e93b3374e4 ("hwrng: Kconfig - Add helper dependency on COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for your patch, which is now commit efaa2d815a0e4d1c ("hwrng:
nomadik - add ARM_AMBA dependency") upstream.
> --- a/drivers/char/hw_random/Kconfig
> +++ b/drivers/char/hw_random/Kconfig
> @@ -312,6 +312,7 @@ config HW_RANDOM_INGENIC_TRNG
> config HW_RANDOM_NOMADIK
> tristate "ST-Ericsson Nomadik Random Number Generator support"
> depends on ARCH_NOMADIK || COMPILE_TEST
> + depends on ARM_AMBA
> default HW_RANDOM
> help
> This driver provides kernel-side support for the Random Number
After seeing CONFIG_HW_RANDOM_NOMADIK disappear from m68k
all{mod,yes}config, I became intrigued, as it did build fine before?
If CONFIG_ARM_AMBA is not enabled, both __amba_driver_register() and
amba_driver_unregister() become static inline dummies, and the rest
of the code and data is not referenced, thus optimized away by the
compiler. I verified this is the case on amd64 allmodconfig, too.
How come this failed for you?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] hwrng: nomadik: add ARM_AMBA dependency
2025-10-06 8:23 ` Geert Uytterhoeven
@ 2025-10-06 9:06 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-10-06 9:06 UTC (permalink / raw)
To: Geert Uytterhoeven, Arnd Bergmann
Cc: Olivia Mackall, Herbert Xu, Cai Huoqing, Dragan Simic,
Francesco Dolcini, Daniel Golle, Christian Marangi,
Aurelien Jarno, Markus Mayer, Lukas Bulwahn, Nicolas Frattaroli,
linux-crypto, linux-kernel
On Mon, Oct 6, 2025, at 10:23, Geert Uytterhoeven wrote:
> On Tue, 29 Jul 2025 at 17:28, Arnd Bergmann <arnd@kernel.org> wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Compile-testing this driver is only possible when the AMBA bus driver is
>> available in the kernel:
>>
>> x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_remove':
>> nomadik-rng.c:(.text+0x67): undefined reference to `amba_release_regions'
>> x86_64-linux-ld: drivers/char/hw_random/nomadik-rng.o: in function `nmk_rng_probe':
>> nomadik-rng.c:(.text+0xee): undefined reference to `amba_request_regions'
>> x86_64-linux-ld: nomadik-rng.c:(.text+0x18d): undefined reference to `amba_release_regions'
>>
>> The was previously implied by the 'depends on ARCH_NOMADIK', but needs to be
>> specified for the COMPILE_TEST case.
>>
>> Fixes: d5e93b3374e4 ("hwrng: Kconfig - Add helper dependency on COMPILE_TEST")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Thanks for your patch, which is now commit efaa2d815a0e4d1c ("hwrng:
> nomadik - add ARM_AMBA dependency") upstream.
>
>> --- a/drivers/char/hw_random/Kconfig
>> +++ b/drivers/char/hw_random/Kconfig
>> @@ -312,6 +312,7 @@ config HW_RANDOM_INGENIC_TRNG
>> config HW_RANDOM_NOMADIK
>> tristate "ST-Ericsson Nomadik Random Number Generator support"
>> depends on ARCH_NOMADIK || COMPILE_TEST
>> + depends on ARM_AMBA
>> default HW_RANDOM
>> help
>> This driver provides kernel-side support for the Random Number
>
> After seeing CONFIG_HW_RANDOM_NOMADIK disappear from m68k
> all{mod,yes}config, I became intrigued, as it did build fine before?
> If CONFIG_ARM_AMBA is not enabled, both __amba_driver_register() and
> amba_driver_unregister() become static inline dummies, and the rest
> of the code and data is not referenced, thus optimized away by the
> compiler. I verified this is the case on amd64 allmodconfig, too.
> How come this failed for you?
I believe this was the result of new build options getting adding
to the randconfig test matrix. If for any reason the
__amba_driver_register() function does not get inlined, the caller
will still have a permanent reference to the amba_driver structure,
and the rest of the file does not get removed by dead-code elimination.
Most likely this change happens because the __init attribute on
the module_init function puts it into a separate section from
the __amba_driver_register() function, causing the compiler to
refuse inlining them. Marking __amba_driver_register() as
__always_inline, or changing the amba_driver_register() macro
to not pass the pointer should also work here.
Arnd
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-06 9:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-29 15:28 [PATCH] hwrng: nomadik: add ARM_AMBA dependency Arnd Bergmann
2025-08-16 9:34 ` Herbert Xu
2025-10-06 8:23 ` Geert Uytterhoeven
2025-10-06 9:06 ` Arnd Bergmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.