Skip to contentSkip to conversation

crypto: qcom: add HW_RANDOM dependency

PATCH In review Arnd Bergmann 3 participants 3 messages Oct 16, 2023 – Oct 17, 2023 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: qcom: add HW_RANDOM dependency

From: Arnd Bergmann <[email protected]>

The driver now calls into the hwrng subsystem and causes a link failure if that is not reachable:

x86_64-linux-ld: vmlinux.o: in function `qcom_rng_probe':
qcom-rng.c:(.text+0xfefc7e): undefined reference to `devm_hwrng_register'

Add a Kconfig dependency as we have for the pure hw_random drivers. I see that there are some other crypto drivers that instead use 'select HW_RANDOM', but those seem to be mistakes as that may lead to circular dependencies, and a simple driver should not force-enable an entire subsytem.

Fixes f29cd5bb64c25 ("crypto: qcom-rng - Add hw_random interface support")
---
 drivers/crypto/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/Kconfig +1 -0
index c761952f0dc6d..79c3bb9c99c3b 100644
@@ -601,6 +601,7 @@ config CRYPTO_DEV_QCE_SW_MAX_LEN
 config CRYPTO_DEV_QCOM_RNG
 	tristate "Qualcomm Random Number Generator Driver"
 	depends on ARCH_QCOM || COMPILE_TEST
+	depends on HW_RANDOM
 	select CRYPTO_RNG
 	help
 	  This driver provides support for the Random Number
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The driver now calls into the hwrng subsystem and causes a link failure if that is not reachable:

x86_64-linux-ld: vmlinux.o: in function `qcom_rng_probe':
qcom-rng.c:(.text+0xfefc7e): undefined reference to `devm_hwrng_register'

Quoted 8 lines

Add a Kconfig dependency as we have for the pure hw_random drivers. I see that there are some other crypto drivers that instead use 'select HW_RANDOM', but those seem to be mistakes as that may lead to circular dependencies, and a simple driver should not force-enable an entire subsytem.

Fixes f29cd5bb64c25 ("crypto: qcom-rng - Add hw_random interface support")

---

Quoted 15 lines
  drivers/crypto/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/crypto/Kconfig +1 -0
index c761952f0dc6d..79c3bb9c99c3b 100644
@@ -601,6 +601,7 @@ config CRYPTO_DEV_QCE_SW_MAX_LEN
  config CRYPTO_DEV_QCOM_RNG
  	tristate "Qualcomm Random Number Generator Driver"
  	depends on ARCH_QCOM || COMPILE_TEST
+	depends on HW_RANDOM
  	select CRYPTO_RNG
  	help
  	  This driver provides support for the Random Number
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 24 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The driver now calls into the hwrng subsystem and causes a link failure if that is not reachable:

x86_64-linux-ld: vmlinux.o: in function `qcom_rng_probe':
qcom-rng.c:(.text+0xfefc7e): undefined reference to `devm_hwrng_register'

Add a Kconfig dependency as we have for the pure hw_random drivers. I see that there are some other crypto drivers that instead use 'select HW_RANDOM', but those seem to be mistakes as that may lead to circular dependencies, and a simple driver should not force-enable an entire subsytem.

Fixes f29cd5bb64c25 ("crypto: qcom-rng - Add hw_random interface support")
---
  drivers/crypto/Kconfig | 1 +
  1 file changed, 1 insertion(+)
drivers/crypto/Kconfig +0 -0
index c761952f0dc6d..79c3bb9c99c3b 100644

drivers/crypto/Kconfig config CRYPTO_DEV_QCE_SW_MAX_LEN · line 607

Quoted 7 lines
drivers/crypto/Kconfig +1 -0
@@ -601,6 +601,7 @@ config CRYPTO_DEV_QCE_SW_MAX_LEN
  config CRYPTO_DEV_QCOM_RNG
  	tristate "Qualcomm Random Number Generator Driver"
  	depends on ARCH_QCOM || COMPILE_TEST
+	depends on HW_RANDOM
  	select CRYPTO_RNG
  	help
  	  This driver provides support for the Random Number