2020-04-27 11:36:53

by Hadar Gat

[permalink] [raw]
Subject: [PATCH v3 0/3] hwrng: cctrng kconfig updates

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


2020-04-27 11:36:57

by Hadar Gat

[permalink] [raw]
Subject: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF

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

Signed-off-by: Hadar Gat <[email protected]>
---
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

2020-04-27 11:37:09

by Hadar Gat

[permalink] [raw]
Subject: [PATCH v3 2/3] hwrng: cctrng - change default to n

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 <[email protected]>
---
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

2020-04-27 11:38:47

by Hadar Gat

[permalink] [raw]
Subject: [PATCH v3 3/3] hwrng: cctrng - update help description

Improved the HW_RANDOM_CCTRNG help description.

Signed-off-by: Hadar Gat <[email protected]>
---
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

2020-04-27 15:08:36

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF

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 <[email protected]>
> ---
> 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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-04-28 12:27:22

by Hadar Gat

[permalink] [raw]
Subject: RE: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF


> From: [email protected] <linux-crypto-
> [email protected]> 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 <[email protected]>
> > ---
> > 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 <[email protected]> Home Page:
> http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-04-28 12:31:19

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF

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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-04-28 15:32:14

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] hwrng: cctrng - change default to n

On Mon, Apr 27, 2020 at 1:39 PM Hadar Gat <[email protected]> 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 <[email protected]>

Acked-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

2020-04-30 07:40:38

by Hadar Gat

[permalink] [raw]
Subject: RE: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF


> -----Original Message-----
> From: [email protected] <linux-crypto-
> [email protected]> 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 <[email protected]> Home Page:
> http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-04-30 07:51:18

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF

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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-04-30 08:26:48

by Hadar Gat

[permalink] [raw]
Subject: RE: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF


> From: [email protected] <linux-crypto-
> [email protected]> 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

2020-04-30 14:11:28

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v3 1/3] hwrng: cctrng - Add dependency on OF

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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

2020-05-08 06:06:46

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] hwrng: cctrng kconfig updates

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 <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt