linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] hwrng: cctrng kconfig updates
@ 2020-04-27 11:36 Hadar Gat
  2020-04-27 11:36 ` [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF Hadar Gat
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Hadar Gat @ 2020-04-27 11:36 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Hadar Gat, Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu,
	Tomer Maimon, Randy Dunlap
  Cc: linux-crypto, linux-kernel, Gilad Ben-Yossef, Ofir Drang

Some fixes in Kconfig for cctrng:
 + add missing dependency on OF
 + change default to 'n'
 + improve inaccurate help description

v3 change: fixed compilation issue
v2 changes:
  + remove unneeded depends on HW_RANDOM.
  + remove unneeded line 'default n' in order to follow the convention.
  + in help description changed to: If unsure, say 'N'

Hadar Gat (3):
  hwrng: cctrng - Add dependency on OF
  hwrng: cctrng - change default to n
  hwrng: cctrng - update help description

 drivers/char/hw_random/Kconfig | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

-- 
2.7.4


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

* [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-27 11:36 [PATCH v3 0/3] hwrng: cctrng kconfig updates Hadar Gat
@ 2020-04-27 11:36 ` Hadar Gat
  2020-04-27 15:06   ` Herbert Xu
  2020-04-27 11:36 ` [PATCH v3 2/3] hwrng: cctrng - change default to n Hadar Gat
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Hadar Gat @ 2020-04-27 11:36 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Hadar Gat, Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu,
	Tomer Maimon, Randy Dunlap
  Cc: linux-crypto, linux-kernel, Gilad Ben-Yossef, Ofir Drang

The cctrng is unusable on non-DT systems so we should depend
on it.

Signed-off-by: Hadar Gat <hadar.gat@arm.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 0c99735..3404716 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -476,7 +476,7 @@ config HW_RANDOM_KEYSTONE
 
 config HW_RANDOM_CCTRNG
 	tristate "Arm CryptoCell True Random Number Generator support"
-	depends on HAS_IOMEM
+	depends on HAS_IOMEM && OF
 	default HW_RANDOM
 	help
 	  This driver provides support for the True Random Number
-- 
2.7.4


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

* [PATCH v3 2/3] hwrng: cctrng - change default to n
  2020-04-27 11:36 [PATCH v3 0/3] hwrng: cctrng kconfig updates Hadar Gat
  2020-04-27 11:36 ` [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF Hadar Gat
@ 2020-04-27 11:36 ` Hadar Gat
  2020-04-28 15:31   ` Geert Uytterhoeven
  2020-04-27 11:36 ` [PATCH v3 3/3] hwrng: cctrng - update help description Hadar Gat
  2020-05-08  6:04 ` [PATCH v3 0/3] hwrng: cctrng kconfig updates Herbert Xu
  3 siblings, 1 reply; 13+ messages in thread
From: Hadar Gat @ 2020-04-27 11:36 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Hadar Gat, Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu,
	Tomer Maimon, Randy Dunlap
  Cc: linux-crypto, linux-kernel, Gilad Ben-Yossef, Ofir Drang

For many users, the Arm CryptoCell HW is not available, so the default for
HW_RANDOM_CCTRNG should to n.
Remove the line to follow the convention - 'n' is the default anyway so no
need to state it explicitly.

Signed-off-by: Hadar Gat <hadar.gat@arm.com>
---
 drivers/char/hw_random/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index 3404716..b98eb1c 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -477,7 +477,6 @@ config HW_RANDOM_KEYSTONE
 config HW_RANDOM_CCTRNG
 	tristate "Arm CryptoCell True Random Number Generator support"
 	depends on HAS_IOMEM && OF
-	default HW_RANDOM
 	help
 	  This driver provides support for the True Random Number
 	  Generator available in Arm TrustZone CryptoCell.
-- 
2.7.4


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

* [PATCH v3 3/3] hwrng: cctrng - update help description
  2020-04-27 11:36 [PATCH v3 0/3] hwrng: cctrng kconfig updates Hadar Gat
  2020-04-27 11:36 ` [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF Hadar Gat
  2020-04-27 11:36 ` [PATCH v3 2/3] hwrng: cctrng - change default to n Hadar Gat
@ 2020-04-27 11:36 ` Hadar Gat
  2020-05-08  6:04 ` [PATCH v3 0/3] hwrng: cctrng kconfig updates Herbert Xu
  3 siblings, 0 replies; 13+ messages in thread
From: Hadar Gat @ 2020-04-27 11:36 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Hadar Gat, Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu,
	Tomer Maimon, Randy Dunlap
  Cc: linux-crypto, linux-kernel, Gilad Ben-Yossef, Ofir Drang

Improved the HW_RANDOM_CCTRNG help description.

Signed-off-by: Hadar Gat <hadar.gat@arm.com>
---
 drivers/char/hw_random/Kconfig | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index b98eb1c..ac00d78 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -478,13 +478,14 @@ config HW_RANDOM_CCTRNG
 	tristate "Arm CryptoCell True Random Number Generator support"
 	depends on HAS_IOMEM && OF
 	help
-	  This driver provides support for the True Random Number
-	  Generator available in Arm TrustZone CryptoCell.
-
-	  To compile this driver as a module, choose M here: the module
+	  Say 'Y' to enable the True Random Number Generator driver for the
+	  Arm TrustZone CryptoCell family of processors.
+	  Currently the CryptoCell 713 and 703 are supported.
+	  The driver is supported only in SoC where Trusted Execution
+	  Environment is not used.
+	  Choose 'M' to compile this driver as a module. The module
 	  will be called cctrng.
-
-	  If unsure, say Y.
+	  If unsure, say 'N'.
 
 endif # HW_RANDOM
 
-- 
2.7.4


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

* Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-27 11:36 ` [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF Hadar Gat
@ 2020-04-27 15:06   ` Herbert Xu
  2020-04-28 12:26     ` Hadar Gat
  0 siblings, 1 reply; 13+ messages in thread
From: Herbert Xu @ 2020-04-27 15:06 UTC (permalink / raw)
  To: Hadar Gat
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang

On Mon, Apr 27, 2020 at 02:36:02PM +0300, Hadar Gat wrote:
> The cctrng is unusable on non-DT systems so we should depend
> on it.
> 
> Signed-off-by: Hadar Gat <hadar.gat@arm.com>
> ---
>  drivers/char/hw_random/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This still doesn't work with COMPILE_TEST.

Cheers,
-- 
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] 13+ messages in thread

* RE: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-27 15:06   ` Herbert Xu
@ 2020-04-28 12:26     ` Hadar Gat
  2020-04-28 12:30       ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Hadar Gat @ 2020-04-28 12:26 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang, nd


> From: linux-crypto-owner@vger.kernel.org <linux-crypto-
> owner@vger.kernel.org> On Behalf Of Herbert Xu
> Sent: Monday, 27 April 2020 18:07
> 
> On Mon, Apr 27, 2020 at 02:36:02PM +0300, Hadar Gat wrote:
> > The cctrng is unusable on non-DT systems so we should depend on it.
> >
> > Signed-off-by: Hadar Gat <hadar.gat@arm.com>
> > ---
> >  drivers/char/hw_random/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> This still doesn't work with COMPILE_TEST.

Hi Herbert,
I've set COMPILE_TEST but couldn't see any problem.
Would you share what doesn't work?
Thanks,
Hadar

> 
> Cheers,
> --
> 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] 13+ messages in thread

* Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-28 12:26     ` Hadar Gat
@ 2020-04-28 12:30       ` Herbert Xu
  2020-04-30  7:39         ` Hadar Gat
  0 siblings, 1 reply; 13+ messages in thread
From: Herbert Xu @ 2020-04-28 12:30 UTC (permalink / raw)
  To: Hadar Gat
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang, nd

On Tue, Apr 28, 2020 at 12:26:31PM +0000, Hadar Gat wrote:
>
> I've set COMPILE_TEST but couldn't see any problem.
> Would you share what doesn't work?

I don't have OF in my config.  This driver builds just fine without
OF.

Cheers,
-- 
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] 13+ messages in thread

* Re: [PATCH v3 2/3] hwrng: cctrng - change default to n
  2020-04-27 11:36 ` [PATCH v3 2/3] hwrng: cctrng - change default to n Hadar Gat
@ 2020-04-28 15:31   ` Geert Uytterhoeven
  0 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2020-04-28 15:31 UTC (permalink / raw)
  To: Hadar Gat
  Cc: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, Linux Crypto Mailing List,
	Linux Kernel Mailing List, Gilad Ben-Yossef, Ofir Drang

On Mon, Apr 27, 2020 at 1:39 PM Hadar Gat <hadar.gat@arm.com> wrote:
> For many users, the Arm CryptoCell HW is not available, so the default for
> HW_RANDOM_CCTRNG should to n.
> Remove the line to follow the convention - 'n' is the default anyway so no
> need to state it explicitly.
>
> Signed-off-by: Hadar Gat <hadar.gat@arm.com>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

* RE: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-28 12:30       ` Herbert Xu
@ 2020-04-30  7:39         ` Hadar Gat
  2020-04-30  7:49           ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Hadar Gat @ 2020-04-30  7:39 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang, nd


> -----Original Message-----
> From: linux-crypto-owner@vger.kernel.org <linux-crypto-
> owner@vger.kernel.org> On Behalf Of Herbert Xu
> 
> On Tue, Apr 28, 2020 at 12:26:31PM +0000, Hadar Gat wrote:
> >
> > I've set COMPILE_TEST but couldn't see any problem.
> > Would you share what doesn't work?
> 
> I don't have OF in my config.  This driver builds just fine without OF.

Yes, it builds, but it is useless.
In include/linux/of.h there are definitions for of_property_read*() functions  for the case of OF_CONFIG not being defined that simply returns -ENOSYS.

> 
> Cheers,
> --
> 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] 13+ messages in thread

* Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-30  7:39         ` Hadar Gat
@ 2020-04-30  7:49           ` Herbert Xu
  2020-04-30  8:26             ` Hadar Gat
  0 siblings, 1 reply; 13+ messages in thread
From: Herbert Xu @ 2020-04-30  7:49 UTC (permalink / raw)
  To: Hadar Gat
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang, nd

On Thu, Apr 30, 2020 at 07:39:14AM +0000, Hadar Gat wrote:
>
> Yes, it builds, but it is useless.

But that's the whole point of COMPILE_TEST.
-- 
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] 13+ messages in thread

* RE: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-30  7:49           ` Herbert Xu
@ 2020-04-30  8:26             ` Hadar Gat
  2020-04-30 14:10               ` Herbert Xu
  0 siblings, 1 reply; 13+ messages in thread
From: Hadar Gat @ 2020-04-30  8:26 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang, nd


> From: linux-crypto-owner@vger.kernel.org <linux-crypto-
> owner@vger.kernel.org> On Behalf Of Herbert Xu
> 
> On Thu, Apr 30, 2020 at 07:39:14AM +0000, Hadar Gat wrote:
> >
> > Yes, it builds, but it is useless.
> 
> But that's the whole point of COMPILE_TEST.

Herbert,
I don't understand if anything need to be fixed before this patch can be applied.
The patch adds dependency on OF, which was missing and is required for the cctrng driver.
(Indeed cctrng compilation passed also without CONFIG_OF because of the empty implementation of of_property_read*() functions that simply returns -ENOSYS.)

Hadar

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

* Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF
  2020-04-30  8:26             ` Hadar Gat
@ 2020-04-30 14:10               ` Herbert Xu
  0 siblings, 0 replies; 13+ messages in thread
From: Herbert Xu @ 2020-04-30 14:10 UTC (permalink / raw)
  To: Hadar Gat
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang, nd

On Thu, Apr 30, 2020 at 08:26:00AM +0000, Hadar Gat wrote:
>
> I don't understand if anything need to be fixed before this patch can be applied.
> The patch adds dependency on OF, which was missing and is required for the cctrng driver.
> (Indeed cctrng compilation passed also without CONFIG_OF because of the empty implementation of of_property_read*() functions that simply returns -ENOSYS.)

Nevermind, I already have the CONFIG_OF flag on in my build test
so it shouldn't be a problem.

Cheers,
-- 
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] 13+ messages in thread

* Re: [PATCH v3 0/3] hwrng: cctrng kconfig updates
  2020-04-27 11:36 [PATCH v3 0/3] hwrng: cctrng kconfig updates Hadar Gat
                   ` (2 preceding siblings ...)
  2020-04-27 11:36 ` [PATCH v3 3/3] hwrng: cctrng - update help description Hadar Gat
@ 2020-05-08  6:04 ` Herbert Xu
  3 siblings, 0 replies; 13+ messages in thread
From: Herbert Xu @ 2020-05-08  6:04 UTC (permalink / raw)
  To: Hadar Gat
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Stefan Wahren, Zaibo Xu, Tomer Maimon,
	Randy Dunlap, linux-crypto, linux-kernel, Gilad Ben-Yossef,
	Ofir Drang

On Mon, Apr 27, 2020 at 02:36:01PM +0300, Hadar Gat wrote:
> Some fixes in Kconfig for cctrng:
>  + add missing dependency on OF
>  + change default to 'n'
>  + improve inaccurate help description
> 
> v3 change: fixed compilation issue
> v2 changes:
>   + remove unneeded depends on HW_RANDOM.
>   + remove unneeded line 'default n' in order to follow the convention.
>   + in help description changed to: If unsure, say 'N'
> 
> Hadar Gat (3):
>   hwrng: cctrng - Add dependency on OF
>   hwrng: cctrng - change default to n
>   hwrng: cctrng - update help description
> 
>  drivers/char/hw_random/Kconfig | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

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

end of thread, other threads:[~2020-05-08  6:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 11:36 [PATCH v3 0/3] hwrng: cctrng kconfig updates Hadar Gat
2020-04-27 11:36 ` [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF Hadar Gat
2020-04-27 15:06   ` Herbert Xu
2020-04-28 12:26     ` Hadar Gat
2020-04-28 12:30       ` Herbert Xu
2020-04-30  7:39         ` Hadar Gat
2020-04-30  7:49           ` Herbert Xu
2020-04-30  8:26             ` Hadar Gat
2020-04-30 14:10               ` Herbert Xu
2020-04-27 11:36 ` [PATCH v3 2/3] hwrng: cctrng - change default to n Hadar Gat
2020-04-28 15:31   ` Geert Uytterhoeven
2020-04-27 11:36 ` [PATCH v3 3/3] hwrng: cctrng - update help description Hadar Gat
2020-05-08  6:04 ` [PATCH v3 0/3] hwrng: cctrng kconfig updates 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).