Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG

2016-10-18 Thread PrasannaKumar Muralidharan
Hi Corentin, I have a few minor comments. On 18 October 2016 at 18:04, Corentin Labbe wrote: > From: LABBE Corentin > > The Security System have a PRNG. > This patch add support for it as an hwrng. > > Signed-off-by: Corentin Labbe > --- > drivers/crypto/Kconfig | 8 >

[PATCH] hw_random: Make explicit that max >= 32 always

2016-11-18 Thread PrasannaKumar Muralidharan
As hw_random core calls ->read with max > 32 or more, make it explicit. Also remove checks involving 'max' being less than 8. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/msm-rng.c | 4 drivers/char/hw_random/pic32-rng.c | 3 --- drivers/char/h

Re: [PATCH v2] crypto: sun4i-ss: support the Security System PRNG

2016-12-08 Thread PrasannaKumar Muralidharan
>> The hwrng interface was always meant to be an interface for real >> hardware random number generators. People rely on that so we >> should not provide bogus entropy sources through this interface. >> > > Why not adding a KCONFIG HW_RANDOM_ACCEPT_ALSO_PRNG with big warning ? > Or a HW_PRNG Kconf

Re: [PATCH v2] crypto: sun4i-ss: support the Security System PRNG

2016-12-13 Thread PrasannaKumar Muralidharan
> What do you think about those two solutions ? I prefer the second solution's idea of using two files (/dev/hwrng and /dev/hwprng). Upon having a quick glance it looks like (based on current_rng == prng check) that your current implementation allows only one rng device to be in use at a time. It

Re: [PATCH v2] crypto: sun4i-ss: support the Security System PRNG

2016-12-14 Thread PrasannaKumar Muralidharan
>> I have found two solutions: > > No we already have algif_rng so let's not confuse things even > further by making hwrng take PRNGs. Even if both the solutions could not be adopted I think there must be a way for applications to use similar API to get true rng or prng. Given the case that no use

Re: Geode LX AES/RNG driver triggers warning

2017-01-06 Thread PrasannaKumar Muralidharan
>> I narrowed it down to commit 6e9b5e76882c ("hwrng: geode - Migrate to >> managed API") which seems to introduce this. It looks to me like some issue >> between devres, the Geode hwrng and AES drivers which both use the same PCI >> device. > > It does > >> I'm no expert here, but I curious if

Re: [PATCH 2/2] hwrng: meson: add clock handling to driver

2017-02-20 Thread PrasannaKumar Muralidharan
On 20 February 2017 at 02:05, Heiner Kallweit wrote: > Add handling of RNG0 clock to the driver. > > Signed-off-by: Heiner Kallweit > --- > drivers/char/hw_random/meson-rng.c | 27 ++- > 1 file changed, 26 insertions(+), 1 deletion(-) > > diff --git a/drivers/char/hw_rand

[PATCH] crypto: Kconfig: Correct help text about feeding entropy pool

2017-07-21 Thread PrasannaKumar Muralidharan
Modify Kconfig help text to reflect the fact that random data from hwrng is fed into kernel random number generator's entropy pool. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/Kconfig | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH 0/6] crypto: Add driver for JZ4780 PRNG

2017-08-17 Thread PrasannaKumar Muralidharan
that are present after the PRNG registers. So instead of reducing the register range, syscon interface is used to expose a register map that is used by both CGU driver and this driver. Changes made to jz4740-cgu.c is only compile tested. PrasannaKumar Muralidharan (6): crypto: jz4780-rng

[PATCH 1/6] crypto: jz4780-rng: Add devicetree bindings for RNG in JZ4780 SoC

2017-08-17 Thread PrasannaKumar Muralidharan
Add devicetree bindings for hardware pseudo random number generator present in Ingenic JZ4780 SoC. Signed-off-by: PrasannaKumar Muralidharan --- .../devicetree/bindings/rng/ingenic,jz4780-rng.txt | 24 ++ 1 file changed, 24 insertions(+) create mode 100644 Documentation

[PATCH 2/6] crypto: jz4780-rng: Make ingenic CGU driver use syscon

2017-08-17 Thread PrasannaKumar Muralidharan
by the PRNG driver. Signed-off-by: PrasannaKumar Muralidharan --- arch/mips/boot/dts/ingenic/jz4740.dtsi | 14 +++ arch/mips/boot/dts/ingenic/jz4780.dtsi | 14 +++ drivers/clk/ingenic/cgu.c | 46 +- drivers/clk/ingenic/cgu.h

[PATCH 3/6] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver

2017-08-17 Thread PrasannaKumar Muralidharan
JZ4780 SoC pseudo random number generator driver using crypto framework. Adding a delay before reading RNG data and disabling RNG after reading data was suggested by Jeffery Walton. Tested-by: Mathieu Malaterre Suggested-by: Jeffrey Walton Signed-off-by: PrasannaKumar Muralidharan

[PATCH 4/6] crypto: jz4780-rng: Add RNG node to jz4780.dtsi

2017-08-17 Thread PrasannaKumar Muralidharan
This patch adds RNG node to jz4780.dtsi. Signed-off-by: PrasannaKumar Muralidharan --- arch/mips/boot/dts/ingenic/jz4780.dtsi | 4 1 file changed, 4 insertions(+) diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi index 1301694..865b9bf 100644

[PATCH 6/6] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig

2017-08-17 Thread PrasannaKumar Muralidharan
Enable PRNG driver support in MIPS Creator CI20 default config. Signed-off-by: PrasannaKumar Muralidharan --- arch/mips/configs/ci20_defconfig | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig index b42cfa7..9f48f2c

[PATCH 5/6] crypto: jz4780-rng: Add myself as mainatainer for JZ4780 PRNG driver

2017-08-17 Thread PrasannaKumar Muralidharan
Add myself as the maintainer of JZ4780 SoC's PRNG drvier. Signed-off-by: PrasannaKumar Muralidharan --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 45ec467..ee8c6f6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6733,6 +6733,11

Re: [PATCH 3/6] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver

2017-08-18 Thread PrasannaKumar Muralidharan
Hi Stephan, On 18 August 2017 at 00:22, Stephan Mueller wrote: > Am Donnerstag, 17. August 2017, 20:25:17 CEST schrieb PrasannaKumar > Muralidharan: > > Hi PrasannaKumar, > >> + >> +static int jz4780_rng_generate(struct crypto_rng *tfm, >> +

Re: [PATCH 2/6] crypto: jz4780-rng: Make ingenic CGU driver use syscon

2017-08-20 Thread PrasannaKumar Muralidharan
Hi Paul, Thanks for your review. On 19 August 2017 at 02:18, Paul Burton wrote: > Hi PrasannaKumar, > > On Thursday, 17 August 2017 11:25:16 PDT PrasannaKumar Muralidharan wrote: >> Ingenic PRNG registers are a part of the same hardware block as clock >> and power stuff.

[PATCH] Documentation: hw_random: Fix issue related to feeding entropy pool

2017-08-22 Thread PrasannaKumar Muralidharan
There is no need to use rng-tools for feeding random data into kernel entropy pool as hw_random core handles it. Documentation suggested that rng-tools is required which is incorrect. So remove it. Signed-off-by: PrasannaKumar Muralidharan --- Documentation/hw_random.txt | 4 1 file

[PATCH] hw_random: timeriomem-rng: Remove 'max < 4' condition check

2017-08-22 Thread PrasannaKumar Muralidharan
In read routiene max is always >= 4. The check whether 'max < 4' is not necessary. Remove it. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/timeriomem-rng.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/char/hw_random/timeriomem-rng.c

[PATCH v2 3/4] crypto: jz4780-rng: Add RNG node to jz4780.dtsi

2017-08-22 Thread PrasannaKumar Muralidharan
Add RNG node to jz4780 dtsi. This driver uses registers that are part of the register set used by Ingenic CGU driver. Make RNG node as child of CGU node. Signed-off-by: PrasannaKumar Muralidharan --- Changes in v2: * Add "syscon" in CGU node's compatible section * Make RNG ch

[PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation

2017-08-22 Thread PrasannaKumar Muralidharan
Add devicetree bindings for hardware pseudo random number generator present in Ingenic JZ4780 SoC. Signed-off-by: PrasannaKumar Muralidharan --- Changes in v2: * Add "syscon" in CGU node's compatible section * Make RNG child node of CGU. .../bindings/crypto/ingenic

[PATCH v2 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver

2017-08-22 Thread PrasannaKumar Muralidharan
JZ4780 SoC pseudo random number generator driver using crypto framework. Adding a delay before reading RNG data and disabling RNG after reading data was suggested by Jeffery Walton. Tested-by: Mathieu Malaterre Suggested-by: Jeffrey Walton Signed-off-by: PrasannaKumar Muralidharan --- Changes

[PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG

2017-08-22 Thread PrasannaKumar Muralidharan
s. CGU driver is not modified in this patch set as registers used by CGU driver and this driver are different. PrasannaKumar Muralidharan (4): crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver crypto: jz4780-rng: Ad

[PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig

2017-08-22 Thread PrasannaKumar Muralidharan
Enable PRNG driver support in MIPS Creator CI20 default config. Signed-off-by: PrasannaKumar Muralidharan --- No changes in v2 arch/mips/configs/ci20_defconfig | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig index

Re: [PATCH] hw_random: timeriomem-rng: Remove 'max < 4' condition check

2017-08-22 Thread PrasannaKumar Muralidharan
Hi Rick, On 22 August 2017 at 22:23, Rick Altherr wrote: > On Tue, Aug 22, 2017 at 9:22 AM, PrasannaKumar Muralidharan > wrote: >> >> In read routiene max is always >= 4. The check whether 'max < 4' is not >> necessary. Remove it. > > Missed tha

Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig

2017-08-23 Thread PrasannaKumar Muralidharan
Hi Harvey, On 23 August 2017 at 14:39, Harvey Hunt wrote: > Hi PrasannaKumar, > > On 23/08/17 03:57, PrasannaKumar Muralidharan wrote: >> >> Enable PRNG driver support in MIPS Creator CI20 default config. >> >> Signed-off-by: PrasannaKumar Muralidharan >&g

[PATCH v2] dt/bindings: exynos-rng: Move dt binding documentation to bindings/crypto

2017-08-23 Thread PrasannaKumar Muralidharan
Samsung exynos PRNG driver is using crypto framework instead of hw_random framework. So move the devicetree binding to crypto folder. Signed-off-by: PrasannaKumar Muralidharan --- Changes in v2: * Modify MAINTAINERS file to reflect file rename .../devicetree/bindings/{rng => crypto}/sams

Re: [PATCH v2 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig

2017-08-23 Thread PrasannaKumar Muralidharan
Hi Harvey, On 23 August 2017 at 20:21, Harvey Hunt wrote: > Hi PrasannaKumar, > > > On 23/08/17 15:50, PrasannaKumar Muralidharan wrote: >> >> Hi Harvey, >> >> On 23 August 2017 at 14:39, Harvey Hunt wrote: >>> >>> Hi PrasannaKumar, >&

Re: [PATCH v2] dt/bindings: exynos-rng: Move dt binding documentation to bindings/crypto

2017-08-23 Thread PrasannaKumar Muralidharan
Hi Krzysztof, On 23 August 2017 at 21:42, Krzysztof Kozlowski wrote: > On Wed, Aug 23, 2017 at 08:34:43PM +0530, PrasannaKumar Muralidharan wrote: >> Samsung exynos PRNG driver is using crypto framework instead of >> hw_random framework. So move the devicetree binding t

Re: [PATCH v2] dt/bindings: exynos-rng: Move dt binding documentation to bindings/crypto

2017-08-23 Thread PrasannaKumar Muralidharan
On 23 August 2017 at 22:24, Krzysztof Kozlowski wrote: > On Wed, Aug 23, 2017 at 10:14:29PM +0530, PrasannaKumar Muralidharan wrote: >> Hi Krzysztof, >> >> On 23 August 2017 at 21:42, Krzysztof Kozlowski wrote: >> > On Wed, Aug 23, 2017 at 08:34:43PM +0530, Pr

Re: [PATCH v2 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation

2017-08-25 Thread PrasannaKumar Muralidharan
Hi Rob, On 26 August 2017 at 03:27, Rob Herring wrote: > On Wed, Aug 23, 2017 at 08:27:04AM +0530, PrasannaKumar Muralidharan wrote: >> Add devicetree bindings for hardware pseudo random number generator >> present in Ingenic JZ4780 SoC. >> >> Signed-off-by:

Re: [PATCH v2 0/4] crypto: Add driver for JZ4780 PRNG

2017-08-26 Thread PrasannaKumar Muralidharan
On 23 August 2017 at 08:27, PrasannaKumar Muralidharan wrote: > This patch series adds support of pseudo random number generator found > in Ingenic's JZ4780 and X1000 SoC. > > Based on Paul's review comments, add 'syscon' compatible in CGU node in > jz4780.

Re: HWRNGs without quality attribute - are they used or not?

2017-09-05 Thread PrasannaKumar Muralidharan
Hi Peter, On 5 September 2017 7:24:02 PM IST, Peter Huewe wrote: >Hi, > >while reading through the analysis of the Linux RNG by the BSI [1][2], >I was suprised by the lack of reflecting on the usage of HWRNGs except >RDRAND/RDSEED. > >In the paper it was mentioned that if the quality attribute

[RFC] tpm: Register RNG device only on tpm chip init

2017-09-06 Thread PrasannaKumar Muralidharan
RNG device is registered as soon as tpm-rng module is loaded even if there are no TPM chip available. Call hwrng_register once tpm chip has registered. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/tpm-rng.c | 50 drivers/char/tpm

[PATCH v3 1/4] crypto: jz4780-rng: Add JZ4780 PRNG devicetree binding documentation

2017-09-18 Thread PrasannaKumar Muralidharan
Add devicetree bindings for hardware pseudo random number generator present in Ingenic JZ4780 SoC. Signed-off-by: PrasannaKumar Muralidharan --- Changes in v3: * Create a cgublock node with "simple-bus" compatible * Make CGU and RNG node as children of cgublock node. Cha

[PATCH v3 0/4] crypto: Add driver for JZ4780 PRNG

2017-09-18 Thread PrasannaKumar Muralidharan
CGU driver. Add 'syscon' compatible in CGU node in jz4780.dtsi. The jz4780-rng driver uses regmap exposed via syscon interface to access the RNG registers. CGU driver is not modified in this patch set as registers used by CGU driver and this driver are different. PrasannaKumar Muralidharan

[PATCH v3 2/4] crypto: jz4780-rng: Add Ingenic JZ4780 hardware PRNG driver

2017-09-18 Thread PrasannaKumar Muralidharan
JZ4780 SoC pseudo random number generator driver using crypto framework. Adding a delay before reading RNG data and disabling RNG after reading data was suggested by Jeffery Walton. Tested-by: Mathieu Malaterre Suggested-by: Jeffrey Walton Signed-off-by: PrasannaKumar Muralidharan --- Changes

[PATCH v3 4/4] crypto: jz4780-rng: Enable PRNG support in CI20 defconfig

2017-09-18 Thread PrasannaKumar Muralidharan
Enable PRNG driver support in MIPS Creator CI20 default config. Signed-off-by: PrasannaKumar Muralidharan --- No changes in v3 No changes in v2 arch/mips/configs/ci20_defconfig | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs

[PATCH v3 3/4] crypto: jz4780-rng: Add RNG node to jz4780.dtsi

2017-09-18 Thread PrasannaKumar Muralidharan
river code. Signed-off-by: PrasannaKumar Muralidharan --- Changes in v3: * Create a cgublock node with "simple-bus" compatible * Make CGU and RNG node as children of cgublock node. Changes in v2: * Add "syscon&

Re: [PATCH] Documentation: hw_random: Fix issue related to feeding entropy pool

2017-09-22 Thread PrasannaKumar Muralidharan
Hi Herbert, On 22 September 2017 at 14:47, Herbert Xu wrote: > PrasannaKumar Muralidharan wrote: >> There is no need to use rng-tools for feeding random data into kernel >> entropy pool as hw_random core handles it. Documentation suggested that >> rng-tools is required w

Re: [RFC PATCH] crypto: make the seed() function optional

2017-10-08 Thread PrasannaKumar Muralidharan
Hi Herbert, On 7 October 2017 at 09:03, Herbert Xu wrote: > Mathieu Malaterre wrote: >> This makes it simplier for driver author to not provide the seed() function >> in case of a pseudo RNG where the seed operation is a no-op. >> >> Document that the seed() function pointer is optional in heade

Re: [PATCH v3 0/4] crypto: Add driver for JZ4780 PRNG

2017-10-12 Thread PrasannaKumar Muralidharan
Hi Herbert, On 12 October 2017 at 20:00, Herbert Xu wrote: > On Mon, Sep 18, 2017 at 07:32:37PM +0530, PrasannaKumar Muralidharan wrote: >> This patch series adds support of pseudo random number generator found >> in Ingenic's JZ4780 and X1000 SoC. >> >> Create

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread PrasannaKumar Muralidharan
On 24 October 2017 at 21:14, Jarkko Sakkinen wrote: > On Mon, Oct 23, 2017 at 10:31:39AM -0600, Jason Gunthorpe wrote: >> On Mon, Oct 23, 2017 at 10:07:31AM -0400, Stefan Berger wrote: >> >> > >-int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) >> > >+int tpm_pcr_extend(int pcr_idx, co

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread PrasannaKumar Muralidharan
Hi Jason, On 24 October 2017 at 21:25, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 09:21:15PM +0530, PrasannaKumar Muralidharan wrote: > >> Please check the RFC [1]. It does use chip id. The rfc has issues and >> has to be fixed but still there could be users of the A

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread PrasannaKumar Muralidharan
On 24 October 2017 at 21:41, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 09:37:33PM +0530, PrasannaKumar Muralidharan wrote: >> Hi Jason, >> >> On 24 October 2017 at 21:25, Jason Gunthorpe >> wrote: >> > On Tue, Oct 24, 2017 at 09:21:15PM +05

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread PrasannaKumar Muralidharan
On 24 October 2017 at 21:53, Jarkko Sakkinen wrote: > On Tue, Oct 24, 2017 at 09:21:15PM +0530, PrasannaKumar Muralidharan wrote: >> On 24 October 2017 at 21:14, Jarkko Sakkinen >> wrote: >> > On Mon, Oct 23, 2017 at 10:31:39AM -0600, Jason Gunthorpe wrote: >> &g

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread PrasannaKumar Muralidharan
On 24 October 2017 at 23:07, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 10:02:00AM -0700, Dmitry Torokhov wrote: >> tpm-rng is abomination that should be kicked out as soon as possible. >> It wrecks havoc with the power management (TPM chip drivers may go >> into suspend state, but tpm_rng d

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-24 Thread PrasannaKumar Muralidharan
Hi Jason, On 24 October 2017 at 23:16, Jason Gunthorpe wrote: > On Tue, Oct 24, 2017 at 09:44:30PM +0530, PrasannaKumar Muralidharan wrote: > >> I am wondering why it is wrong. Isn't the chip id valid till it is >> unregistered? If so the rfc is correct. Please explain,

Re: [PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-25 Thread PrasannaKumar Muralidharan
d entropy from the TPM when it is plugged in, > and allow access to the TPM rng via /dev/hwrng. > > Signed-off-by: PrasannaKumar Muralidharan > Signed-off-by: Jason Gunthorpe > Reviewed-by: Jason Gunthorpe > --- > drivers/char/hw_random/Kconfig | 13 --- > driv

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-25 Thread PrasannaKumar Muralidharan
Hi Jarkko, On 24 October 2017 at 23:52, Jarkko Sakkinen wrote: > On Tue, Oct 24, 2017 at 10:05:20PM +0530, PrasannaKumar Muralidharan wrote: >> > 1. Every user in the kernel is using TPM_ANY_NUM, which means there are >> >no other users. >> >> Completely

Re: [PATCH v2] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-25 Thread PrasannaKumar Muralidharan
Hi Jarkko, On 25 October 2017 at 17:25, Jarkko Sakkinen wrote: > Device number (the character device index) is not a stable identifier > for a TPM chip. That is the reason why every call site passes > TPM_ANY_NUM to tpm_chip_find_get(). > > This commit changes the API in a way that instead a stru

Re: [PATCH] tpm: Move Linux RNG connection to hwrng

2017-10-25 Thread PrasannaKumar Muralidharan
Hi Jason, On 25 October 2017 at 20:48, Jason Gunthorpe wrote: > On Wed, Oct 25, 2017 at 08:15:09PM +0530, PrasannaKumar Muralidharan > wrote: > >> > +static int tpm_add_hwrng(struct tpm_chip *chip) >> > +{ >> > + if (!IS_ENABLED(CONFIG_HW_RANDOM

[PATCH] hw_random: Include device.h instead of declaring struct device

2017-10-26 Thread PrasannaKumar Muralidharan
Include linux/device.h instead of declaring struct device. Signed-off-by: PrasannaKumar Muralidharan --- include/linux/hw_random.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index bee0827..2ec9af7 100644 --- a

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread PrasannaKumar Muralidharan
); > + ret = trusted_tpm_send(tb->data, MAX_BUF_SIZE); > if (ret < 0) { > pr_info("trusted_key: authhmac failed (%d)\n", ret); > return ret; > @@ -748,7 +747,7 @@ static int getoptions(char *c, struct trusted_key_payload > *pa

[PATCH 0/4] Rearrange functions to remove forward declarations

2017-10-26 Thread PrasannaKumar Muralidharan
This patch series rearranges functions such that forward declarations becomes unnecessary. Remove those forward declaration. This patch series is boot tested without user space in qemu with CONFIG_HW_RANDOM=y. PrasannaKumar Muralidharan (4): hw_random: core: Remove forward declaration by

[PATCH 1/4] hw_random: core: Remove forward declaration by rearranging code

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange drop_current_rng such that its forward declaration is not required. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char

[PATCH 3/4] hw_random: core: Rearranging start_khwrngd to remove forward declaration

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange start_khwrngd such that its forward declaration is not required. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 75 +-- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/drivers/char/hw_random/core.c

[PATCH 4/4] hw_random: core: Remove forward declaration of hwrng_init

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange set_current_rng such that hwrng_init's forward declaration can be removed. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/char/hw_random/c

[PATCH 2/4] hw_random: core: Rearranging rng_get_data to remove forward declaration

2017-10-26 Thread PrasannaKumar Muralidharan
Rearrange rng_get_data such that its forward declaration is not required. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 41 +++-- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/char/hw_random/core.c b

Re: [tpmdd-devel] [PATCH] tpm: remove chip_num parameter from in-kernel API

2017-10-26 Thread PrasannaKumar Muralidharan
On 26 October 2017 at 00:41, Jarkko Sakkinen wrote: > On Wed, Oct 25, 2017 at 08:21:16PM +0530, PrasannaKumar Muralidharan wrote: >> >> > 2. Moving struct tpm_rng to the TPM client is architecturally >> >> >uacceptable. >> >> >> >> As t

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-10-26 Thread PrasannaKumar Muralidharan
On 26 October 2017 at 21:39, Jarkko Sakkinen wrote: > On Thu, Oct 26, 2017 at 07:40:49PM +0530, PrasannaKumar Muralidharan wrote: >> Hi Jarkko, >> >> On 26 October 2017 at 19:24, Jarkko Sakkinen >> wrote: >> > Device number (the character device index) is no

[PATCH] hw_random: core: Remove unnecessary new line in MODULE_PARM_DESC

2017-10-26 Thread PrasannaKumar Muralidharan
While using MODULE_PARM_DESC there is a new line which is not required. Remove it. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c

Re: [PATCH 0/4] Rearrange functions to remove forward declarations

2017-10-26 Thread PrasannaKumar Muralidharan
Hi David, On 26 October 2017 at 22:18, David Daney wrote: > On 10/26/2017 08:34 AM, PrasannaKumar Muralidharan wrote: >> >> This patch series rearranges functions such that forward declarations >> becomes unnecessary. Remove those forward declaration. > > > Why? &

[PATCH] hw_random: core: Reset user selected rng by writing "" to rng_current

2017-10-27 Thread PrasannaKumar Muralidharan
User is able to select a chosen rng by writing its name to rng_current but there is no way to reset it without unbinding the rng. Let user write "" to rng_current and delesect the chosen rng. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/c

Re: [PATCH] hw_random: core: Reset user selected rng by writing "" to rng_current

2017-10-30 Thread PrasannaKumar Muralidharan
Hi Harald, On 30 October 2017 at 13:40, Harald Freudenberger wrote: > That's a really good idea. I also thought about something like that. Do you mind reviewing the code? Thanks, PrasannaKumar

Re: [PATCH] hw_random: Include device.h instead of declaring struct device

2017-10-30 Thread PrasannaKumar Muralidharan
Hi Herbert, On 30 October 2017 at 12:22, Herbert Xu wrote: > On Thu, Oct 26, 2017 at 07:12:08PM +0530, PrasannaKumar Muralidharan wrote: >> Include linux/device.h instead of declaring struct device. >> >> Signed-off-by: PrasannaKumar Muralidharan > > Nack. We shoul

Re: [PATCH] hw_random: core: Remove unnecessary new line in MODULE_PARM_DESC

2017-10-30 Thread PrasannaKumar Muralidharan
Hi Herbert, On 30 October 2017 at 12:23, Herbert Xu wrote: > On Thu, Oct 26, 2017 at 10:00:29PM +0530, PrasannaKumar Muralidharan wrote: >> While using MODULE_PARM_DESC there is a new line which is not required. >> Remove it. >> >> Signed-off-by: PrasannaKumar Mu

Re: [PATCH] hw_random: core: Reset user selected rng by writing "" to rng_current

2017-10-30 Thread PrasannaKumar Muralidharan
Hi Harald, On 30 October 2017 at 18:58, Harald Freudenberger wrote: > On 10/27/2017 07:04 PM, PrasannaKumar Muralidharan wrote: >> User is able to select a chosen rng by writing its name to rng_current >> but there is no way to reset it without unbinding the rng. Let user

Re: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume

2017-11-03 Thread PrasannaKumar Muralidharan
Hi Jim, On 3 November 2017 at 15:27, Jim Quigley wrote: > The patch for > > commit: 5c06273401f2eb7b290cadbae18ee00f8f65e893 > Author: Amit Shah > Date: Sun Jul 27 07:34:01 2014 +0930 > > virtio: rng: delay hwrng_register() till driver is ready > > moved the call to hwrng_register() out of

Fwd: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume

2017-11-03 Thread PrasannaKumar Muralidharan
Did reply instead of reply all. Forwarding my previous message. -- Forwarded message -- From: PrasannaKumar Muralidharan Date: 3 November 2017 at 20:19 Subject: Re: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume To: Jim Quigley Hi Jim, On 3

Re: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume

2017-11-03 Thread PrasannaKumar Muralidharan
Hi Jim, Have second thoughts on this. On 3 November 2017 at 20:55, PrasannaKumar Muralidharan wrote: >> >> It would be cleaner to just get rid of probe_common() altogether in that >> case, and do whatever >> needs to be done in virtrng_probe()/virtrng_res

Re: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume

2017-11-03 Thread PrasannaKumar Muralidharan
it has no effect. > + err = hwrng_register(&vi->hwrng); > + if (!err) { > + vi->hwrng_register_done = true; > + vi->hwrng_removed = false; > + } > + } > + > + return err; > } > #endif > > -- > 1.8.3.1 > I am fine with this change as is. Reviewed-by: PrasannaKumar Muralidharan Regards, PrasannaKumar

Re: virtio:rng: Virtio RNG devices need to be re-registered after suspend/resume

2017-11-06 Thread PrasannaKumar Muralidharan
Hi Herbert, On 6 November 2017 at 12:39, Herbert Xu wrote: > On Fri, Nov 03, 2017 at 09:57:21AM +, Jim Quigley wrote: >> moved the call to hwrng_register() out of the probe routine into the scan >> routine. We need to call hwrng_register() after a suspend/restore cycle >> to re-register the d

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-06 Thread PrasannaKumar Muralidharan
Hi Jason, On 6 November 2017 at 07:57, Jason Gunthorpe wrote: > On Sun, Nov 05, 2017 at 01:05:06PM +0200, Jarkko Sakkinen wrote: > >> I asked to create a series for a reason. Now this doesn't apply because I >> don't have an ancestor in my git history. > > It would be unusual for me to put your p

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-09 Thread PrasannaKumar Muralidharan
Hi Jason, On 7 November 2017 at 21:34, Jason Gunthorpe wrote: > On Tue, Nov 07, 2017 at 08:50:44AM +0530, PrasannaKumar Muralidharan wrote: > >> I am assuming you are talking about the following patches - using >> struct tpm_chip instead of chip number and this patch. >

Re: [PATCH v3] tpm: use struct tpm_chip for tpm_chip_find_get()

2017-11-11 Thread PrasannaKumar Muralidharan
Did basic check on tpm rng patch, it works fine. As it depends on this patch this should be working fine too. Tested-by: PrasannaKumar Muralidharan Regards, PrasannaKumar

Re: [PATCH v2] tpm: Move Linux RNG connection to hwrng

2017-11-11 Thread PrasannaKumar Muralidharan
Hi Jason, On 9 November 2017 at 21:59, Jason Gunthorpe wrote: > On Thu, Nov 09, 2017 at 09:49:33PM +0530, PrasannaKumar Muralidharan wrote: >> Hi Jason, >> >> On 7 November 2017 at 21:34, Jason Gunthorpe wrote: >> > On Tue, Nov 07, 2017 at 08:50:44AM +0530, Pr

Re: PATCH : Fix NULL pointer dereference on no default_rng

2017-11-12 Thread PrasannaKumar Muralidharan
Would you mind sending the patch using 'git send-email'? Kernel community does not accept attachments. Regards, PrasannaKumar

Re: [PATCH] Fix NULL pointer deref. on no default_rng

2017-11-12 Thread PrasannaKumar Muralidharan
if (crypto_get_default_rng()) > - err = -EFAULT; > + return -EFAULT; > > err = crypto_rng_get_bytes(crypto_default_rng, (u8 *)priv, nbytes); > crypto_put_default_rng(); > -- > 2.15.0 > Looks good to me. Reviewed-by: PrasannaKumar Muralidharan Regards, PrasannaKumar

Re: [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()'

2017-11-20 Thread PrasannaKumar Muralidharan
579,7 @@ static int hifn_probe(struct pci_dev *pdev, const > struct pci_device_id *id) > for (i = 0; i < 3; ++i) > if (dev->bar[i]) > iounmap(dev->bar[i]); > + kfree(dev); > > err_out_free_regions: > pci_release_regions(pdev); > -- > 2.14.1 > Nice catch. Reviewed-by: PrasannaKumar Muralidharan Regards, PrasannaKumar

Re: [PATCH 2/3] hwrng: exynos - add Samsung Exynos True RNG driver

2017-11-24 Thread PrasannaKumar Muralidharan
Hi Lukasz, Some minor comments below. On 23 November 2017 at 20:39, Łukasz Stelmach wrote: > Add support for True Random Number Generator found in Samsung Exynos > 5250+ SoCs. > > Signed-off-by: Łukasz Stelmach > --- > MAINTAINERS | 7 + > drivers/char/hw_random/Kcon

Re: [PATCH 2/3] hwrng: exynos - add Samsung Exynos True RNG driver

2017-11-24 Thread PrasannaKumar Muralidharan
On 24 November 2017 at 20:55, PrasannaKumar Muralidharan wrote: > Hi Lukasz, > > Some minor comments below. > > On 23 November 2017 at 20:39, Łukasz Stelmach wrote: >> Add support for True Random Number Generator found in Samsung Exynos >> 5250+ SoCs. >>

Re: [PATCH v3 0/4] crypto: Add driver for JZ4780 PRNG

2017-11-25 Thread PrasannaKumar Muralidharan
Hi Ralf, On 12 October 2017 at 22:59, PrasannaKumar Muralidharan wrote: > Hi Herbert, > > On 12 October 2017 at 20:00, Herbert Xu wrote: >> On Mon, Sep 18, 2017 at 07:32:37PM +0530, PrasannaKumar Muralidharan wrote: >>> This patch series adds support of pseudo rando

Re: [PATCH v2 2/3] hwrng: exynos - add Samsung Exynos True RNG driver

2017-12-05 Thread PrasannaKumar Muralidharan
return 0; > +} > + > +static int __maybe_unused exynos_trng_resume(struct device *dev) > +{ > + int ret; > + > + ret = pm_runtime_get_sync(dev); > + if (ret < 0) { > + dev_err(dev, "Could not get runtime PM.\n"); > + pm_runtime_put_noidle(dev); > + return ret; > + } > + > + return 0; > +} > + > +static SIMPLE_DEV_PM_OPS(exynos_trng_pm_ops, exynos_trng_suspend, > +exynos_trng_resume); > + > +static const struct of_device_id exynos_trng_dt_match[] = { > + { > + .compatible = "samsung,exynos5250-trng", > + }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, exynos_rng_dt_match); > + > +static struct platform_driver exynos_trng_driver = { > + .driver = { > + .name = "exynos-trng", > + .pm = &exynos_trng_pm_ops, > + .of_match_table = exynos_trng_dt_match, > + }, > + .probe = exynos_trng_probe, > + .remove = exynos_trng_remove, > +}; > + > +module_platform_driver(exynos_trng_driver); > +MODULE_AUTHOR("Łukasz Stelmach"); > +MODULE_DESCRIPTION("H/W TRNG driver for Exynos chips"); > +MODULE_LICENSE("GPL"); > -- > 2.11.0 > Reviewed-by: PrasannaKumar Muralidharan Regards, PrasannaKumar

Re: [PATCH v2] hwrng: Clean up RNG list when last hwrng is unregistered

2017-12-17 Thread PrasannaKumar Muralidharan
Hi Gary, Some minor comments below. On 16 December 2017 at 01:25, Gary R Hook wrote: > > Commit 142a27f0a731 added support for a "best" RNG, and in doing so > introduced a hang from rmmod/modprobe -r when the last RNG on the list > was unloaded. Nice catch. Thanks for fixing this. > When the h

Re: [PATCH v2] hwrng: Clean up RNG list when last hwrng is unregistered

2017-12-17 Thread PrasannaKumar Muralidharan
On 17 December 2017 at 14:53, PrasannaKumar Muralidharan wrote: > Hi Gary, > > Some minor comments below. > > On 16 December 2017 at 01:25, Gary R Hook wrote: >> >> Commit 142a27f0a731 added support for a "best" RNG, and in doing so >> introduced a ha

Re: [PATCH] [RFT] crypto: aes-generic - turn off -ftree-pre and -ftree-sra

2017-12-21 Thread PrasannaKumar Muralidharan
Hi Ard, On 21 December 2017 at 17:52, Ard Biesheuvel wrote: > On 21 December 2017 at 10:20, Arnd Bergmann wrote: >> On Wed, Dec 20, 2017 at 10:46 PM, Jakub Jelinek wrote: >>> On Wed, Dec 20, 2017 at 09:52:05PM +0100, Arnd Bergmann wrote: diff --git a/crypto/aes_generic.c b/crypto/aes_gener

[PATCH] Add Ingenic JZ4780 hardware RNG driver

2016-08-17 Thread PrasannaKumar Muralidharan
This patch adds support for hardware random number generator present in JZ4780 SoC. Signed-off-by: PrasannaKumar Muralidharan --- .../devicetree/bindings/rng/ingenic,jz4780-rng.txt | 12 +++ MAINTAINERS| 5 + arch/mips/boot/dts/ingenic/jz4780.dtsi

Re: [PATCH] Add Ingenic JZ4780 hardware RNG driver

2016-08-17 Thread PrasannaKumar Muralidharan
On 17 August 2016 at 21:31, Daniel Thompson wrote: > On 17/08/16 16:35, PrasannaKumar Muralidharan wrote: >> >> This patch adds support for hardware random number generator present in >> JZ4780 SoC. >> >> Signed-off-by: PrasannaKumar Muralidharan >> ---

Re: [PATCH] Add Ingenic JZ4780 hardware RNG driver

2016-08-17 Thread PrasannaKumar Muralidharan
w_random/jz4780-rng.c >> @@ -0,0 +1,105 @@ >> +/* >> + * jz4780-rng.c - Random Number Generator driver for J4780 >> + * >> + * Copyright 2016 (C) PrasannaKumar Muralidharan >> >> + * >> + * This file is licensed under the terms of the GNU General Public &g

Re: [PATCH] Add Ingenic JZ4780 hardware RNG driver

2016-08-19 Thread PrasannaKumar Muralidharan
> Please forgive my ignorance Prasanna... > > For the JZ4780 I have, there are two registers in play. The first is > the control register which enables/disables the RNG. The control > register is named ERNG. The second register is the data register, and > it produces the random stream. The data reg

Re: [PATCH] Add Ingenic JZ4780 hardware RNG driver

2016-08-19 Thread PrasannaKumar Muralidharan
> __ARM_FEATURE_UNALIGNED (cf., > http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0774f/chr1383660321827.html) > . MIPSEL does not define such a macro. > > # MIPS ci20 creator with GCC 4.6 > $ gcc -march=native -dM -E - #define __BIGGEST_ALIGNMENT__ 8 > > If the MIPS CPU

[PATCH] hw_random: omap3-rom-rng.c: Remove obsoleted functions

2016-08-20 Thread PrasannaKumar Muralidharan
Remove omap3_rom_rng_data_present method as it was returning 1 always. Use .read callback instead of .data_read callback. This avoids use of obsolete callbacks. This patch is not tested with hardware as I don't have access to it. Signed-off-by: PrasannaKumar Muralidharan --- drivers

[PATCH] hwrng: pasemi_rng.c: Migrate to managed API

2016-08-25 Thread PrasannaKumar Muralidharan
Use devm_ioremap and devm_hwrng_register instead of ioremap and hwrng_register. This removes unregistering and error handling code. This patch is not tested with hardware as I don't have access to it. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/pasemi-rng.c

Re: [PATCH] hwrng: pasemi_rng.c: Migrate to managed API

2016-08-25 Thread PrasannaKumar Muralidharan
> I will propose to use devm_ioremap_resource() instead for removing this > hardcoded 0x100, but i cannot find any user of this driver in any dts. (And > so cannot check that this 0x100 is given in any DT resource node) > > Is this normal ? I wanted to use devm_ioremap_resource but could not fin

[PATCH] hw_random: Remove check for max less than 4 bytes

2016-08-26 Thread PrasannaKumar Muralidharan
HW RNG core never asks for data less than 4 bytes. The check whether max is less than 4 bytes is unnecessary. Remove the check. Signed-off-by: PrasannaKumar Muralidharan --- drivers/char/hw_random/meson-rng.c | 3 --- drivers/char/hw_random/st-rng.c| 3 --- 2 files changed, 6 deletions

[PATCH v2 1/4] hw_random: jz4780-rng: Add devicetree bindings for RNG in JZ4780 SoC

2016-08-27 Thread PrasannaKumar Muralidharan
Add devicetree bindings for hardware random number generator present in Ingenic JZ4780 SoC. Signed-off-by: PrasannaKumar Muralidharan Acked-by: Rob Herring --- Documentation/devicetree/bindings/rng/ingenic,jz4780-rng.txt | 12 1 file changed, 12 insertions(+) create mode 100644

[PATCH v2 0/4] hw_random: Add driver for Ingenic JZ4780 SoC RNG

2016-08-27 Thread PrasannaKumar Muralidharan
This is the v2 patch series that adds support for random number generator present in Ingenic JZ4780 SoC. Patch 1: Add device tree bindings for RNG in JZ4780 SoC. Patch 2: Add Ingenic JZ4780 hardware RNG driver. Patch 3: Add RNG to jz4780.dtsi. Patch 4: Enable RNG in ci20_defconfig PrasannaKumar

[PATCH v2 4/4] hw_random: jz4780-rng: Enable hardware RNG in CI20 defconfig

2016-08-27 Thread PrasannaKumar Muralidharan
This patch enables the usage of RNG in MIPS Creator CI20 default config. Signed-off-by: PrasannaKumar Muralidharan --- arch/mips/configs/ci20_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig

[PATCH v2 3/4] hw_random: jz4780-rng: Add RNG node to jz4780.dtsi

2016-08-27 Thread PrasannaKumar Muralidharan
This patch adds RNG node to jz4780.dtsi. Signed-off-by: PrasannaKumar Muralidharan --- arch/mips/boot/dts/ingenic/jz4780.dtsi | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/boot/dts/ingenic/jz4780.dtsi b/arch/mips/boot/dts/ingenic/jz4780.dtsi index b868b42

  1   2   >