linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Default Kconfig state for hw_random drivers
@ 2012-04-26 11:42 Mark Brown
  2012-04-26 14:17 ` Olof Johansson
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-04-26 11:42 UTC (permalink / raw)
  To: Herbert Xu, Matt Mackall, Olof Johansson; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

An Atmel hw_random driver just appeared in -next.  Since it's just a
regular platform device it has no dependencies on any particular
platform so following the behaviour of other hw_random drivers it's set
to default enabled if hw_random is enabled, even on non-Atmel platforms.

This doesn't feel like the right thing to do - it'd mean that most of
the embedded RNGs would end up getting enabled by default which probably
isn't what we want.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default Kconfig state for hw_random drivers
  2012-04-26 11:42 Default Kconfig state for hw_random drivers Mark Brown
@ 2012-04-26 14:17 ` Olof Johansson
  2012-04-26 14:41   ` Mark Brown
  2012-04-27 12:31   ` Nicolas Ferre
  0 siblings, 2 replies; 10+ messages in thread
From: Olof Johansson @ 2012-04-26 14:17 UTC (permalink / raw)
  To: Mark Brown
  Cc: Herbert Xu, Matt Mackall, linux-kernel, Arnd Bergmann, Nicolas Ferre

On Thu, Apr 26, 2012 at 4:42 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> An Atmel hw_random driver just appeared in -next.  Since it's just a
> regular platform device it has no dependencies on any particular
> platform so following the behaviour of other hw_random drivers it's set
> to default enabled if hw_random is enabled, even on non-Atmel platforms.
>
> This doesn't feel like the right thing to do - it'd mean that most of
> the embedded RNGs would end up getting enabled by default which probably
> isn't what we want.

Indeed, thanks for catching this. The driver isn't new but it had a
previous dependency on just one AT91 chip family.

Looking at other options in the same Kconfig, it would be appropriate
to make it depend on ARCH_AT91 instead.

Nicolas?


-Olof

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default Kconfig state for hw_random drivers
  2012-04-26 14:17 ` Olof Johansson
@ 2012-04-26 14:41   ` Mark Brown
  2012-04-27 12:31   ` Nicolas Ferre
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Brown @ 2012-04-26 14:41 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Herbert Xu, Matt Mackall, linux-kernel, Arnd Bergmann, Nicolas Ferre

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

On Thu, Apr 26, 2012 at 07:17:25AM -0700, Olof Johansson wrote:

> Looking at other options in the same Kconfig, it would be appropriate
> to make it depend on ARCH_AT91 instead.

Possibly wants an || AVR32 dependency of some kind too?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default Kconfig state for hw_random drivers
  2012-04-26 14:17 ` Olof Johansson
  2012-04-26 14:41   ` Mark Brown
@ 2012-04-27 12:31   ` Nicolas Ferre
  2012-04-27 12:36     ` Mark Brown
  1 sibling, 1 reply; 10+ messages in thread
From: Nicolas Ferre @ 2012-04-27 12:31 UTC (permalink / raw)
  To: Olof Johansson, Mark Brown, Arnd Bergmann, balbi
  Cc: Herbert Xu, Matt Mackall, linux-kernel

On 04/26/2012 04:17 PM, Olof Johansson :
> On Thu, Apr 26, 2012 at 4:42 AM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
>> An Atmel hw_random driver just appeared in -next.  Since it's just a
>> regular platform device it has no dependencies on any particular
>> platform so following the behaviour of other hw_random drivers it's set
>> to default enabled if hw_random is enabled, even on non-Atmel platforms.
>>
>> This doesn't feel like the right thing to do - it'd mean that most of
>> the embedded RNGs would end up getting enabled by default which probably
>> isn't what we want.
> 
> Indeed, thanks for catching this. The driver isn't new but it had a
> previous dependency on just one AT91 chip family.
> 
> Looking at other options in the same Kconfig, it would be appropriate
> to make it depend on ARCH_AT91 instead.
> 
> Nicolas?

Hi,

I had the same kind of discussion with Felipe and Arnd in this thread:
http://thread.gmane.org/gmane.linux.ports.arm.kernel/122248/focus=122304

The conclusion came out after Arnd's strong arguments:
http://article.gmane.org/gmane.linux.ports.arm.kernel/122962

Maybe adding a "default" directive can be an valid option?

Best regards,
-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default Kconfig state for hw_random drivers
  2012-04-27 12:31   ` Nicolas Ferre
@ 2012-04-27 12:36     ` Mark Brown
  2012-04-27 12:55       ` Arnd Bergmann
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-04-27 12:36 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Olof Johansson, Arnd Bergmann, balbi, Herbert Xu, Matt Mackall,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 896 bytes --]

On Fri, Apr 27, 2012 at 02:31:36PM +0200, Nicolas Ferre wrote:

> I had the same kind of discussion with Felipe and Arnd in this thread:
> http://thread.gmane.org/gmane.linux.ports.arm.kernel/122248/focus=122304

> The conclusion came out after Arnd's strong arguments:
> http://article.gmane.org/gmane.linux.ports.arm.kernel/122962

> Maybe adding a "default" directive can be an valid option?

There is one, that's the problem - the driver is defaulting to the same
state as the main hw_random option (as is idiomatic for this subsystem).
This means that if you've enabled any hw_random device this driver will
be enabled by default.  I would argue that this default directive only
makes sense if there's an explicit dependency limiting the platforms it
can build on.  If it can build on any platform then omitting the default
and just defaulting to N as is normal for drivers would be better.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default Kconfig state for hw_random drivers
  2012-04-27 12:36     ` Mark Brown
@ 2012-04-27 12:55       ` Arnd Bergmann
  2012-04-27 17:35         ` Mark Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Arnd Bergmann @ 2012-04-27 12:55 UTC (permalink / raw)
  To: Mark Brown
  Cc: Nicolas Ferre, Olof Johansson, balbi, Herbert Xu, Matt Mackall,
	linux-kernel

On Friday 27 April 2012, Mark Brown wrote:
> There is one, that's the problem - the driver is defaulting to the same
> state as the main hw_random option (as is idiomatic for this subsystem).
> This means that if you've enabled any hw_random device this driver will
> be enabled by default.  I would argue that this default directive only
> makes sense if there's an explicit dependency limiting the platforms it
> can build on.  If it can build on any platform then omitting the default
> and just defaulting to N as is normal for drivers would be better.

How about making it default to (HW_RANDOM && ARCH_AT91) then?

	Arnd

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Default Kconfig state for hw_random drivers
  2012-04-27 12:55       ` Arnd Bergmann
@ 2012-04-27 17:35         ` Mark Brown
  2012-04-30  9:49           ` [PATCH] hwrng: Kconfig: modify default state for atmel-rng driver Nicolas Ferre
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-04-27 17:35 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Nicolas Ferre, Olof Johansson, balbi, Herbert Xu, Matt Mackall,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

On Fri, Apr 27, 2012 at 12:55:36PM +0000, Arnd Bergmann wrote:
> On Friday 27 April 2012, Mark Brown wrote:

> > There is one, that's the problem - the driver is defaulting to the same
> > state as the main hw_random option (as is idiomatic for this subsystem).
> > This means that if you've enabled any hw_random device this driver will
> > be enabled by default.  I would argue that this default directive only
> > makes sense if there's an explicit dependency limiting the platforms it
> > can build on.  If it can build on any platform then omitting the default
> > and just defaulting to N as is normal for drivers would be better.

> How about making it default to (HW_RANDOM && ARCH_AT91) then?

Yes, something like that would do the job too.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] hwrng: Kconfig: modify default state for atmel-rng driver
  2012-04-27 17:35         ` Mark Brown
@ 2012-04-30  9:49           ` Nicolas Ferre
  2012-04-30  9:55             ` Mark Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Ferre @ 2012-04-30  9:49 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, herbert
  Cc: broonie, arnd, olof, Nicolas Ferre

In order to prevent building the Atmel hw_random driver for each and every
configuration, add a "default" Kconfig state in relation with
CONFIG_ARCH_AT91.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/char/hw_random/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index b2402eb..d98998f 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -63,7 +63,7 @@ config HW_RANDOM_AMD
 config HW_RANDOM_ATMEL
 	tristate "Atmel Random Number Generator support"
 	depends on HW_RANDOM && HAVE_CLK
-	default HW_RANDOM
+	default (HW_RANDOM && ARCH_AT91)
 	---help---
 	  This driver provides kernel-side support for the Random Number
 	  Generator hardware found on Atmel AT91 devices.
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] hwrng: Kconfig: modify default state for atmel-rng driver
  2012-04-30  9:49           ` [PATCH] hwrng: Kconfig: modify default state for atmel-rng driver Nicolas Ferre
@ 2012-04-30  9:55             ` Mark Brown
  2012-04-30 10:02               ` Herbert Xu
  0 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2012-04-30  9:55 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: linux-kernel, linux-arm-kernel, herbert, arnd, olof

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

On Mon, Apr 30, 2012 at 11:49:13AM +0200, Nicolas Ferre wrote:
> In order to prevent building the Atmel hw_random driver for each and every
> configuration, add a "default" Kconfig state in relation with
> CONFIG_ARCH_AT91.
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] hwrng: Kconfig: modify default state for atmel-rng driver
  2012-04-30  9:55             ` Mark Brown
@ 2012-04-30 10:02               ` Herbert Xu
  0 siblings, 0 replies; 10+ messages in thread
From: Herbert Xu @ 2012-04-30 10:02 UTC (permalink / raw)
  To: Mark Brown; +Cc: Nicolas Ferre, linux-kernel, linux-arm-kernel, arnd, olof

On Mon, Apr 30, 2012 at 10:55:12AM +0100, Mark Brown wrote:
> On Mon, Apr 30, 2012 at 11:49:13AM +0200, Nicolas Ferre wrote:
> > In order to prevent building the Atmel hw_random driver for each and every
> > configuration, add a "default" Kconfig state in relation with
> > CONFIG_ARCH_AT91.
> > 
> > Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> 
> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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] 10+ messages in thread

end of thread, other threads:[~2012-04-30 10:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-26 11:42 Default Kconfig state for hw_random drivers Mark Brown
2012-04-26 14:17 ` Olof Johansson
2012-04-26 14:41   ` Mark Brown
2012-04-27 12:31   ` Nicolas Ferre
2012-04-27 12:36     ` Mark Brown
2012-04-27 12:55       ` Arnd Bergmann
2012-04-27 17:35         ` Mark Brown
2012-04-30  9:49           ` [PATCH] hwrng: Kconfig: modify default state for atmel-rng driver Nicolas Ferre
2012-04-30  9:55             ` Mark Brown
2012-04-30 10:02               ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).