[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 <prasannatsmku...@gmail.com> --- .../devicetree/bindings/rng/ingenic,jz4780-rng.txt | 12 +++ MAINTAINERS| 5 + arch/mip

Re: [PATCH] Add Ingenic JZ4780 hardware RNG driver

2016-08-17 Thread PrasannaKumar Muralidharan
On 17 August 2016 at 21:31, Daniel Thompson <daniel.thomp...@linaro.org> 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: Pr

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 >> <prasannatsmku...@gmail.com> >> + * >> + * This file is licensed

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

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

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

[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 <prasannats

[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 <prasannatsmku...@gmail.com> --- driver

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

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

2016-09-02 Thread PrasannaKumar Muralidharan
> I don't like this change. The RNG registers are documented as a part of > the same hardware block as the clock & power stuff which the CGU driver > handles, and indeed in the M200 SoC there is a power-related register > after the RNG registers. So shortening the range covered by the CGU > driver

[PATCH] hwrng: pasemi-rng - Use linux/io.h instead of asm/io.h

2016-09-06 Thread PrasannaKumar Muralidharan
Checkpatch.pl warns about usage of asm/io.h. Use linux/io.h instead. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/char/hw_random/pasemi-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/pasemi-rng.c b/d

Re: [PATCH 4/9] hwrng: omap - Use the managed device resource API for registration

2016-09-06 Thread PrasannaKumar Muralidharan
> Use devm_hwrng_register instead of hwrng_register. It avoids the need > to handle unregistration explicitly from the remove function. > > Signed-off-by: Romain Perier > --- > drivers/char/hw_random/omap-rng.c | 4 +--- > 1 file changed, 1 insertion(+), 3

Re: hwrng: pasemi_rng.c: Migrate to managed API

2016-09-01 Thread PrasannaKumar Muralidharan
> I didn't explain well, There is a CFE command 'show devtree' here's the > relevant bits (I Hope) This is much simple than I expected. > [CFE ]CFE> show devtree > [/] > | #interrupt-cells val 0x0002 > | #address-cells val 0x0002 > | #size-cells

Re: [PATCH] hwrng: core - Allocate memory during module init

2016-09-07 Thread PrasannaKumar Muralidharan
> On Sun, Sep 04, 2016 at 01:59:38PM +0530, PrasannaKumar Muralidharan wrote: >> >> @@ -573,6 +557,17 @@ EXPORT_SYMBOL_GPL(devm_hwrng_unregister); >> >> static int __init hwrng_modinit(void) >> { >> + /* kmalloc makes this safe for virt_to_page()

[PATCH] hwrng: core - Allocate memory during module init

2016-09-04 Thread PrasannaKumar Muralidharan
hwrng_register call. Also moving them to module init makes it explicit that it is freed in module exit. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/char/hw_random/core.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff

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

2016-09-04 Thread PrasannaKumar Muralidharan
was suggested by LABBE Corentin. CC: Darren Stevens <dar...@stevens-zone.net> Suggested-by: LABBE Corentin <clabbe.montj...@gmail.com> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/char/hw_random/pasemi-rng.c | 37 +++--

Re: [PATCH 4/9] hwrng: omap - Use the managed device resource API for registration

2016-09-07 Thread PrasannaKumar Muralidharan
On 7 September 2016 at 19:53, Romain Perier <romain.per...@free-electrons.com> wrote: > Hello, > > > Le 06/09/2016 18:31, PrasannaKumar Muralidharan a écrit : >>> >>> Use devm_hwrng_register instead of hwrng_register. It avoids the need >>> to han

Re: hwrng: pasemi_rng.c: Migrate to managed API

2016-08-30 Thread PrasannaKumar Muralidharan
Hi Darren, >> I wanted to use devm_ioremap_resource but could not find DT entry >> required for this driver in any of the .dts files. So did not change >> that. I could not find any dts/dtsi for this platform. So I assume >> that the dtb is not present in the kernel, dtb is supplied by the >>

[PATCH] hwrng: geode-rng - Use linux/io.h instead of asm/io.h

2016-09-11 Thread PrasannaKumar Muralidharan
Fix checkpatch.pl warning by changing from asm/io.h to linux/io.h. In the mean time arrange the includes in alphabetical order. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/char/hw_random/geode-rng.c | 8 1 file changed, 4 insertions(+), 4 del

[PATCH] hwrng: geode-rng - Migrate to managed API

2016-09-11 Thread PrasannaKumar Muralidharan
Use devm_ioremap and devm_hwrng_register instead of ioremap and hwrng_register. This removes error handling code. Also moved code around by removing goto statements. This improves code readability. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/char/hw_

Re: [PATCH -next] hwrng: amd - Fix return value check in mod_init()

2016-09-16 Thread PrasannaKumar Muralidharan
> In case of error, the function devm_kzalloc() or devm_ioport_map() > return NULL pointer not ERR_PTR(). The IS_ERR() test in the return > value check should be replaced with NULL test. > > Fixes: 31b2a73c9c5f ("hwrng: amd - Migrate to managed API") > Signed-off-by: Wei Yongjun

[PATCH] Use devm_hwrng_register instead of hwrng_register

2016-08-28 Thread PrasannaKumar Muralidharan
By using devm_hwrng_register instead of hwrng_register the .remove callback in platform_driver can be removed. This reduces a few lines in code. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/char/hw_random/tx4939-rng.c | 11 +-- 1 file chan

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

2016-08-27 Thread PrasannaKumar Muralidharan
in alphabetical order Adding a delay before reading RNG data and disabling RNG after reading data was suggested by Jeffery Walton. Suggested-by: Jeffrey Walton <noloa...@gmail.com> Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- MAINTAINERS

[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 <prasannatsmku...@gmail.com> Acked-by: Rob Herring <r...@kernel.org> --- Documentation/devicetree/bindings/rng/ingenic,jz4780-rng.txt | 12

[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] 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 <prasannatsmku...@gmail.com> --- drivers/char/hw_random/meson-rng.c | 3 --- drivers/char/hw_random/st-rng.c| 3

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

2016-08-28 Thread PrasannaKumar Muralidharan
>> cgu: jz4780-cgu@1000 { >> compatible = "ingenic,jz4780-cgu"; >> - reg = <0x1000 0x100>; >> + reg = <0x1000 0xD8>; > > >I think lower case is preferred here. Sure, will change. -- To unsubscribe from this list: send the line

[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 <prasannatsmku...@gmail.com> --- drivers/char/hw_random/msm-rng.c | 4 drivers/char/hw_random/pic32

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

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

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 v2 2/5] crypto: stm32 - Support for STM32 CRC32 crypto module

2017-03-23 Thread PrasannaKumar Muralidharan
On 21 March 2017 at 20:43, Fabien Dessenne wrote: > This module registers a CRC32 ("Ethernet") and a CRC32C (Castagnoli) > algorithm that make use of the STMicroelectronics STM32 crypto hardware. > > Theses algorithms are compatible with the little-endian generic ones. >

Re: [PATCH v2 2/5] crypto: stm32 - Support for STM32 CRC32 crypto module

2017-03-24 Thread PrasannaKumar Muralidharan
On 24 March 2017 at 15:26, Fabien DESSENNE <fabien.desse...@st.com> wrote: > On 24/03/17 05:28, PrasannaKumar Muralidharan wrote: >> On 21 March 2017 at 20:43, Fabien Dessenne <fabien.desse...@st.com> wrote: >>> This module registers a CRC32 ("Ethernet")

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

2017-03-26 Thread PrasannaKumar Muralidharan
> Oh my, if you are right with your first guess, this is a bad DRNG design. > > Just out of curiousity: what happens if a caller invokes the seed function > twice or more times (each time with the sufficient amount of bits)? What is > your guess here? Should the second seed use the random data

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

2017-03-26 Thread PrasannaKumar Muralidharan
On 26 March 2017 at 21:31, Krzysztof Kozlowski <k...@kernel.org> wrote: > On Sun, Mar 26, 2017 at 08:50:42PM +0530, PrasannaKumar Muralidharan wrote: >> .Have some minor comments. Please feel free to correct if I am wrong. >> >> On 25 March 2017 at 21:56, Krzysztof

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

2017-03-26 Thread PrasannaKumar Muralidharan
.Have some minor comments. Please feel free to correct if I am wrong. On 25 March 2017 at 21:56, Krzysztof Kozlowski wrote: > Replace existing hw_ranndom/exynos-rng driver with a new, reworked one. > This is a driver for pseudo random number generator block which on > Exynos4

Re: Question - seeding the hw pseudo random number generator

2017-03-20 Thread PrasannaKumar Muralidharan
> I looked at Exynos Pseudo Random Nubmer Generator driver > (drivers/char/hw_random/exynos-rng.c) and noticed that it always seeds > the device with jiffies. Then I looked at few other drivers and found > that they do not seed themself (or at least I couldn't find this). HW random interface is

Re: [PATCH 2/2] hwrng: mtk: Add driver for hardware random generator on MT7623 SoC

2017-04-13 Thread PrasannaKumar Muralidharan
Hi Sean, Mostly looks good, have few minor comments. On 13 April 2017 at 12:35, wrote: > +static bool mtk_rng_wait_ready(struct hwrng *rng, bool wait) > +{ > + struct mtk_rng *priv = to_mtk_rng(rng); > + int ready; > + > + ready = readl(priv->base +

Re: [PATCH 2/2] hwrng: mtk: Add driver for hardware random generator on MT7623 SoC

2017-04-13 Thread PrasannaKumar Muralidharan
turn retval || !wait ? retval : -EIO;" I use can also help handling > the both cases in one line which i think is elegant enough. > > And retval is accumulated with each round if some data's existing in > hardware, so we don't return the value from mtk_rng_wait_ready(). retval ca

Re: [RFC PATCH v1 1/1] crypto: algif_compression - User-space interface for compression

2017-04-13 Thread PrasannaKumar Muralidharan
On 14 April 2017 at 00:04, Abed Kamaluddin wrote: > crypto: algif_compression - User-space interface for compression > > This patch adds af_alg plugin for compression algorithms of type scomp/acomp > registered to the kernel crypto layer. > > The user needs to set operation

Re: [PATCH 3/3] crypto: hwrng add sysfs attribute to show user selected rng

2017-07-10 Thread PrasannaKumar Muralidharan
+495,7 @@ void hwrng_unregister(struct hwrng *rng) > list_del(>list); > if (current_rng == rng) { > drop_current_rng(); > +cur_rng_set_by_user = 0; > /* rng_list is sorted by quality, use the best (=first) one */ > if (!list_empty(_list)) { &

Re: [PATCH] crypto: change hwrng device default permissions to 0444

2017-07-13 Thread PrasannaKumar Muralidharan
Hi Herbert, On 12 July 2017 at 15:43, Herbert Xu wrote: > Hmm, one usage scenario for /dev/hwrng is to feed rngd which then > feeds into /dev/random. In that case it may not be desirable to > allow arbitrary access to hwrgn since it may cause the rate of > entropy

Re: [PATCH 3/3] hwrng: mxc-fsl - add support for Freescale RNGC

2017-07-17 Thread PrasannaKumar Muralidharan
Hi Martin, On 18 July 2017 at 02:46, Martin Kaiser wrote: > From: Steffen Trumtrar > > The driver is ported from Freescales Linux git and can be > found in the > > vendor/freescale/imx_2.6.35_maintain > > branch. > > According to that code,

Re: [PATCH v4 3/3] hwrng: mxc-fsl - add support for Freescale RNGC

2017-07-20 Thread PrasannaKumar Muralidharan
truct mxc_rngc *rngc = platform_get_drvdata(pdev); > + > + hwrng_unregister(>rng); > + > + clk_disable_unprepare(rngc->clk); > + > + return 0; > +} > + > +#ifdef CONFIG_PM > +static int mxc_rngc_suspend(struct device *dev) > +{ > + struct mxc_rngc *rngc = dev_get_drvdata(dev); > + > + clk_disable_unprepare(rngc->clk); > + > + return 0; > +} > + > +static int mxc_rngc_resume(struct device *dev) > +{ > + struct mxc_rngc *rngc = dev_get_drvdata(dev); > + > + clk_prepare_enable(rngc->clk); > + > + return 0; > +} > + > +static const struct dev_pm_ops mxc_rngc_pm_ops = { > + .suspend= mxc_rngc_suspend, > + .resume = mxc_rngc_resume, > +}; > +#endif > + > +static const struct of_device_id mxc_rngc_dt_ids[] = { > + { .compatible = "fsl,imx25-rng", .data = NULL, }, > + { /* sentinel */ } > +}; > +MODULE_DEVICE_TABLE(of, mxc_rngc_dt_ids); > + > +static struct platform_driver mxc_rngc_driver = { > + .driver = { > + .name = "mxc_rngc", > +#ifdef CONFIG_PM > + .pm = _rngc_pm_ops, > +#endif > + .of_match_table = mxc_rngc_dt_ids, > + }, > + .remove = __exit_p(mxc_rngc_remove), > +}; > + > +module_platform_driver_probe(mxc_rngc_driver, mxc_rngc_probe); > + > +MODULE_AUTHOR("Freescale Semiconductor, Inc."); > +MODULE_DESCRIPTION("H/W RNGC driver for i.MX"); > +MODULE_LICENSE("GPL"); > -- > 2.1.4 > Regardless of the minor suggestion, code looks good to me as is. Reviewed-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com>. Note: Add my reviewed by tag if you are going for next version. Regards, PrasannaKumar

[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 <prasannatsmku...@gmail.com> --- drivers/char/hw_random/Kconfig | 6 ++ 1 file changed, 2 insertions(+), 4 del

Re: [PATCH 1/2] crypto: Make hwrng choose rng source by quality.

2017-06-29 Thread PrasannaKumar Muralidharan
tail = list_entry(rng_list.prev, struct hwrng, list); > + struct hwrng *new_rng; > > - set_current_rng(tail); > + new_rng = list_entry(rng_list.next, struct hwrng, > list); > + set_current_rng(new_rng); > } > } > > -- > 2.7.4 > This patch looks good. I am fine with this patch as is. Reviewed-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> If this patch is split into please go ahead and my reviewed-by tag. Regards, PrasannaKumar

Re: [PATCH 3/3] crypto: hwrng add sysfs attribute to show user selected rng

2017-07-04 Thread PrasannaKumar Muralidharan
On 3 July 2017 at 15:33, Harald Freudenberger wrote: > This patch introduces a new sysfs attribute file 'rng_selected' > which shows the the rng chosen by userspace. > > If a rng source is chosen by user via echo some valid string > to rng_current there should be a way

Re: [PATCH 1/3] crypto: hwrng use rng source with best quality

2017-07-04 Thread PrasannaKumar Muralidharan
l = list_entry(rng_list.prev, struct hwrng, list); > + struct hwrng *new_rng; > > - set_current_rng(tail); > + new_rng = list_entry(rng_list.next, struct hwrng, > list); > + set_current_rng(new_rng); > } > } > > -- > 2.7.4 > Looks good to me. Reviewed-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com>. Regards, PrasannaKumar

Re: [PATCH 2/3] crypto: hwrng remember rng chosen by user

2017-07-04 Thread PrasannaKumar Muralidharan
ng) { > drop_current_rng(); > + cur_rng_set_by_user = 0; > /* rng_list is sorted by quality, use the best (=first) one */ > if (!list_empty(_list)) { > struct hwrng *new_rng; > -- > 2.7.4 > Looks good to me. Reviewed-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com>. Regards, PrasannaKumar

Re: [PATCH 3/3] crypto: hwrng add sysfs attribute to show user selected rng

2017-07-05 Thread PrasannaKumar Muralidharan
Hi Harald, > Here is an updated version with just showing 0 or 1 in the new sysfs > attribute file: > == cut == > From: Harald Freudenberger > Date: Mon, 3 Jul 2017 10:19:22 +0200 > Subject: [PATCH 3/3] crypto: hwrng add sysfs attribute to show user

[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 <prasannatsmku...@gmail.com> --- Changes in v2: * Add "syscon" in CGU node's co

[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 <prasannatsmku...@gmail.com> --- Changes in v2: * Add "syscon" in CGU node's compatible section * Make RNG child node of CGU. .../binding

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

2017-08-22 Thread PrasannaKumar Muralidharan
; Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- Changes in v2: * Fixed buffer overflow in generate function pointed out in Stephan's review * Fold patch that had only MAINTAINERS file change with this patch * Removed unnecessary comment in code MAINTAINERS

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

2017-08-22 Thread PrasannaKumar Muralidharan
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: Add RNG node to jz4780

[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 <prasannatsmku...@gmail.com> --- No changes in v2 arch/mips/configs/ci20_defconfig | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/configs/ci20_defconfig b/arc

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 <ralth...@google.com> wrote: > On Tue, Aug 22, 2017 at 9:22 AM, PrasannaKumar Muralidharan > <prasannatsmku...@gmail.com> wrote: >> >> In read routiene max is always >= 4. The check whether 'max < 4' is not

[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 <prasannatsmku...@gmail.com> --- Documen

[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 <prasannatsmku...@gmail.com> --- drivers/char/hw_random/timeriomem-rng.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/ch

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 <paul.bur...@imgtec.com> 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 clo

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 <smuel...@chronox.de> 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] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 13:17, Mike Frysinger wrote: >> Completely untested patch below. Will something like this work? >> >> --- a/drivers/char/hw_random/tpm-rng.c >> +++ b/drivers/char/hw_random/tpm-rng.c >> @@ -35,7 +35,13 @@ static int tpm_rng_read(struct hwrng *rng, void >>

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 12:22, PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> wrote: > On 12 May 2017 at 12:11, Mike Frysinger <vap...@chromium.org> wrote: >> On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: >>> On 12 May 2017 at 09:47, Mike Frysi

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 09:47, Mike Frysinger wrote: > From: Mike Frysinger > > If you build in hwrng & tpm-rng, but boot on a system that doesn't > have a tpm (like via KVM), hwrng will spam the logs every 10 seconds > with the line: > hwrng: no data

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 12:11, Mike Frysinger <vap...@chromium.org> wrote: > On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: >> On 12 May 2017 at 09:47, Mike Frysinger <vap...@gentoo.org> wrote: >> > From: Mike Frysinger <vap...@chromium.org> >&

Re: [PATCH v1 2/2] hw_random: timeriomem_rng: Allow setting RNG quality from platform data

2017-05-17 Thread PrasannaKumar Muralidharan
Hi Rick, Minor comment below. On 18 May 2017 at 03:59, Rick Altherr wrote: > When a hw_random device's quality is non-zero, it will automatically be > used to fill the kernel's entropy pool. Since timeriomem_rng is used by > many different devices, the quality needs to be

Re: [PATCH] hwrng: do not warn when there are no devices

2017-06-20 Thread PrasannaKumar Muralidharan
On 20 June 2017 at 00:33, Mike Frysinger <vap...@chromium.org> wrote: > On Mon, Jun 19, 2017 at 2:43 AM, PrasannaKumar Muralidharan wrote: >> On 19 June 2017 at 11:51, Herbert Xu wrote: >>> On Sun, Jun 18, 2017 at 10:00:17PM -0700, Mike Frysinger wrote: >>>>

Re: [PATCH] crypto: exynoes-rng: Set cra_ctxsize to 0

2017-05-21 Thread PrasannaKumar Muralidharan
On 21 May 2017 at 12:44, Krzysztof Kozlowski <k...@kernel.org> wrote: > On Sun, May 21, 2017 at 9:11 AM, PrasannaKumar Muralidharan > <prasannatsmku...@gmail.com> wrote: >> Hi Krzysztof >> >> On 21 May 2017 at 11:56, Krzysztof Kozlowski <k...@kernel.org>

[PATCH] crypto: exynoes-rng: Set cra_ctxsize to 0

2017-05-21 Thread PrasannaKumar Muralidharan
As cra_ctxsize is set but the allocated space is not used, set it 0. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/crypto/exynos-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/exynos-rng.c b/drivers/crypto/

Re: [PATCH] crypto: exynoes-rng: Set cra_ctxsize to 0

2017-05-21 Thread PrasannaKumar Muralidharan
Hi Krzysztof On 21 May 2017 at 11:56, Krzysztof Kozlowski <k...@kernel.org> wrote: > On Sun, May 21, 2017 at 8:09 AM, PrasannaKumar Muralidharan > <prasannatsmku...@gmail.com> wrote: >> As cra_ctxsize is set but the allocated space is not used, set it 0. > > Why do

Re: [PATCH v6 4/5] crypto: inside-secure: add SafeXcel EIP197 crypto engine driver

2017-05-27 Thread PrasannaKumar Muralidharan
Hi Antonie, On 24 May 2017 at 19:40, Antoine Tenart wrote: > Add support for Inside Secure SafeXcel EIP197 cryptographic engine, > which can be found on Marvell Armada 7k and 8k boards. This driver > currently implements: ecb(aes), cbc(aes), sha1, sha224,

Re: [PATCH v6 4/5] crypto: inside-secure: add SafeXcel EIP197 crypto engine driver

2017-05-29 Thread PrasannaKumar Muralidharan
On 29 May 2017 at 14:51, Antoine Tenart wrote: >> As you have got help from other people for testing, wouldn't it be >> nice to add tested-by tag? > > Well, they're listed as authors of the driver: not only they helped to > test it but they developed parts of

Re: [PATCH] hwrng: do not warn when there are no devices

2017-06-19 Thread PrasannaKumar Muralidharan
On 19 June 2017 at 11:51, Herbert Xu wrote: > On Sun, Jun 18, 2017 at 10:00:17PM -0700, Mike Frysinger wrote: >> >> in order to make tpm-rng react in the way you're implying, the TPM >> subsystem would need to add a notification chain for transitions from >>

[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 <prasannatsmku...@gmail.com> --- No changes in v3 No changes in v2 arch/mips/configs/ci20_defconfig | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/c

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

2017-09-18 Thread PrasannaKumar Muralidharan
. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- Changes in v3: * Create a cgublock node with "simple-bus" compatible * Make CGU and RNG node as children of cgublock node. Changes in v2:

[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 <prasannatsmku...@gmail.com> --- Changes in v3: * Create a cgublock node with "simple-bus" compatible * Make CGU and RNG node as children

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

2017-09-18 Thread PrasannaKumar Muralidharan
river. 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 (4): crypto:

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

2017-09-18 Thread PrasannaKumar Muralidharan
; Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- Changes in v3: * Add seeding support * Reduce delay Changes in v2: * Fixed buffer overflow in generate function pointed out in Stephan's review

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 <herb...@gondor.apana.org.au> wrote: > PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> wrote: >> There is no need to use rng-tools for feeding random data into kernel >> entropy pool as hw_random cor

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

[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 <prasannatsmku...@gmail.com> --- drivers/char/hw_random/tpm-rng.

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

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 <k...@kernel.org> 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 devicet

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 <r...@kernel.org> 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. >> >

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

2017-08-27 Thread PrasannaKumar Muralidharan
On 23 August 2017 at 08:27, PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> 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 >

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 <k...@kernel.org> 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 <k...@kernel.org> wrote: >> >

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 <harvey.h...@imgtec.com> wrote: > Hi PrasannaKumar, > > > On 23/08/17 15:50, PrasannaKumar Muralidharan wrote: >> >> Hi Harvey, >> >> On 23 August 2017 at 14:39, Harvey Hunt <harvey.h...@imgtec.com>

[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 <prasannatsmku...@gmail.com> --- Changes in v2: * Modify MAINTAINERS file to reflect file rename .../devi

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 <harvey.h...@imgtec.com> 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: Pr

[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: Add

[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 <prasannatsmku...@gmail.com> --- .../devicetree/bindings/rng/ingenic,jz4780-rng.txt | 24 ++ 1 file changed, 24 insertions(+)

[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 <prasannatsmku...@gmail.com> --- arch/mips/boot/dts/ingenic/jz4740.dtsi | 14 +++ arch/mips/boot/dts/ingenic/jz4780.dtsi | 14 +++ drivers/clk/ingenic/cgu.c | 46 +- d

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

2017-08-17 Thread PrasannaKumar Muralidharan
; Signed-off-by: PrasannaKumar Muralidharan <prasannatsmku...@gmail.com> --- drivers/crypto/Kconfig | 19 + drivers/crypto/Makefile | 1 + drivers/crypto/jz4780-rng.c | 173 3 files changed, 193 insertions(+) create mode 100644 drivers/c

[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 <prasannatsmku...@gmail.com> --- 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/jz478

[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 <prasannatsmku...@gmail.com> --- arch/mips/configs/ci20_defconfig | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_def

[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 <prasannatsmku...@gmail.com> --- MAINTAINERS | 5 + 1 file changed, 5 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 45ec467..ee8c6f6 100644 --- a/MAINTAINERS +++ b/MAINT

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 <herb...@gondor.apana.org.au> 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 X1

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

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 <prasannatsmku...@gmail.com> wrote: > Hi Lukasz, > > Some minor comments below. > > On 23 November 2017 at 20:39, Łukasz Stelmach <l.stelm...@samsung.com> wrote: >> Add support for True Random Number Generato

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 <prasannatsmku...@gmail.com> wrote: > Hi Herbert, > > On 12 October 2017 at 20:00, Herbert Xu <herb...@gondor.apana.org.au> wrote: >> On Mon, Sep 18, 2017 at 07:32:37PM +0530, PrasannaKumar Muralidharan w

  1   2   >