Unknown mailing list, search.

Re: [build bug] ./drivers/crypto/hifn_795x.c

Previous thread: 2.6.24-rt1 by Steven Rostedt on Friday, January 25, 2008 - 6:17 pm. (2 messages)

Next thread: Re: [PATCH 3/4] firewire: enforce access order between generation and node ID by Stefan Richter on Friday, January 25, 2008 - 6:25 pm. (1 message)
To: <linux-kernel@...>, Linus Torvalds <torvalds@...>, Herbert Xu <herbert@...>
Date: Friday, January 25, 2008 - 6:21 pm

randconfig testing found this (post-v2.6.24) build bug:

drivers/built-in.o: In function `hifn_unregister_rng':
hifn_795x.c:(.text+0x17bbd9): undefined reference to `hwrng_unregister'
drivers/built-in.o: In function `hifn_probe':
hifn_795x.c:(.text+0x17df70): undefined reference to `hwrng_register'

config attached.

i tried to reply to the pull request on lkml, but was unable to find
one. The bug came in via:

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (125 commits)

Ingo

To: <linux-kernel@...>, Linus Torvalds <torvalds@...>, Herbert Xu <herbert@...>
Date: Friday, January 25, 2008 - 7:51 pm

find a workaround below - but i'm not sure it's the right one.

Ingo

Index: linux/drivers/crypto/Kconfig
===================================================================
--- linux.orig/drivers/crypto/Kconfig
+++ linux/drivers/crypto/Kconfig
@@ -89,6 +89,7 @@ config CRYPTO_DEV_HIFN_795X
select CRYPTO_ALGAPI
select CRYPTO_BLKCIPHER
depends on PCI
+ depends on DEV_HIFN_795X = HW_RANDOM
help
This option allows you to have support for HIFN 795x crypto adapters.

--

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>
Date: Friday, January 25, 2008 - 7:53 pm

Thanks, but I've already checked in a fix :)
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--

To: Herbert Xu <herbert@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>
Date: Friday, January 25, 2008 - 7:59 pm

hey, that's my punishment for not reading my email promptly :) Could
have saved me some time in the Kconfig web of dependencies :-/

Ingo
--

To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>, Linus Torvalds <torvalds@...>, Linux Crypto Mailing List <linux-crypto@...>, Evgeniy Polyakov <johnpol@...>
Date: Friday, January 25, 2008 - 6:45 pm

I'll fix it with the following patch.

Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 74bd599..8a70a9e 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -88,10 +88,16 @@ config CRYPTO_DEV_HIFN_795X
select CRYPTO_DES
select CRYPTO_ALGAPI
select CRYPTO_BLKCIPHER
+ select HW_RANDOM if CRYPTO_DEV_HIFN_795X_RNG
depends on PCI
help
This option allows you to have support for HIFN 795x crypto adapters.

-
+config CRYPTO_DEV_HIFN_795X_RNG
+ bool "HIFN 795x random number generator"
+ depends on CRYPTO_DEV_HIFN_795X
+ help
+ Select this option if you want to enable the random number generator
+ on the HIFN 795x crypto adapters.

endif # CRYPTO_HW
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 16413e5..dfbf24c 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -463,7 +463,7 @@ struct hifn_device

unsigned int pk_clk_freq;

-#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
+#ifdef CRYPTO_DEV_HIFN_795X_RNG
unsigned int rng_wait_time;
ktime_t rngtime;
struct hwrng rng;
@@ -795,7 +795,7 @@ static struct pci2id {
}
};

-#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
+#ifdef CRYPTO_DEV_HIFN_795X_RNG
static int hifn_rng_data_present(struct hwrng *rng, int wait)
{
struct hifn_device *dev = (struct hifn_device *)rng->priv;
@@ -880,7 +880,7 @@ static int hifn_init_pubrng(struct hifn_device *dev)
dprintk("Chip %s: RNG engine has been successfully initialised.\n",
dev->name);

-#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
+#ifdef CRYPTO_DEV_HIFN_795X_RNG
/* First value must be discarded */
hifn_read_1(dev, HIFN_1_RNG_DATA);
dev->rngtime ...

To: Herbert Xu <herbert@...>
Cc: Ingo Molnar <mingo@...>, <linux-kernel@...>, Linus Torvalds <torvalds@...>, Linux Crypto Mailing List <linux-crypto@...>
Date: Saturday, January 26, 2008 - 6:43 am

Hi.

Thanks for fixing that up, if people who do not like select will
complain, we can make hifn rng depend on hw_random.

--
Evgeniy Polyakov
--

Previous thread: 2.6.24-rt1 by Steven Rostedt on Friday, January 25, 2008 - 6:17 pm. (2 messages)

Next thread: Re: [PATCH 3/4] firewire: enforce access order between generation and node ID by Stefan Richter on Friday, January 25, 2008 - 6:25 pm. (1 message)