All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-02-15 13:03 ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

This set of patches add extended functionalities for stm32 rng
driver.
Patch #1 includes a reset during probe to avoid any error status
which can occur during bootup process and keep safe rng integrity.

Patch #3 adds a new property to manage the clock error detection
feature which can be disabled on specific target.

Patch #5 rework the timeout calculation for read value that was
previously defined based on loop operation and is now based on
timer.

Lionel Debieve (5):
  hwrng: stm32 - add reset during probe
  dt-bindings: rng: add reset node for stm32
  hwrng: stm32 - allow disable clock error detection
  dt-bindings: rng: add clock detection error for stm32
  hwrng: stm32 - rework read timeout calculation

 .../devicetree/bindings/rng/st,stm32-rng.txt       |  4 ++
 drivers/char/hw_random/stm32-rng.c                 | 44 ++++++++++++++--------
 2 files changed, 32 insertions(+), 16 deletions(-)

-- 
2.15.1

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

* [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-02-15 13:03 ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

This set of patches add extended functionalities for stm32 rng
driver.
Patch #1 includes a reset during probe to avoid any error status
which can occur during bootup process and keep safe rng integrity.

Patch #3 adds a new property to manage the clock error detection
feature which can be disabled on specific target.

Patch #5 rework the timeout calculation for read value that was
previously defined based on loop operation and is now based on
timer.

Lionel Debieve (5):
  hwrng: stm32 - add reset during probe
  dt-bindings: rng: add reset node for stm32
  hwrng: stm32 - allow disable clock error detection
  dt-bindings: rng: add clock detection error for stm32
  hwrng: stm32 - rework read timeout calculation

 .../devicetree/bindings/rng/st,stm32-rng.txt       |  4 ++
 drivers/char/hw_random/stm32-rng.c                 | 44 ++++++++++++++--------
 2 files changed, 32 insertions(+), 16 deletions(-)

-- 
2.15.1

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

* [PATCH Resend 1/5] hwrng: stm32 - add reset during probe
  2018-02-15 13:03 ` Lionel Debieve
@ 2018-02-15 13:03   ` Lionel Debieve
  -1 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

Avoid issue when probing the RNG without
reset if bad status has been detected previously

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 63d84e6f1891..83c695938a2d 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -21,6 +21,7 @@
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
+#include <linux/reset.h>
 #include <linux/slab.h>
 
 #define RNG_CR 0x00
@@ -46,6 +47,7 @@ struct stm32_rng_private {
 	struct hwrng rng;
 	void __iomem *base;
 	struct clk *clk;
+	struct reset_control *rst;
 };
 
 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
@@ -140,6 +142,13 @@ static int stm32_rng_probe(struct platform_device *ofdev)
 	if (IS_ERR(priv->clk))
 		return PTR_ERR(priv->clk);
 
+	priv->rst = devm_reset_control_get(&ofdev->dev, NULL);
+	if (!IS_ERR(priv->rst)) {
+		reset_control_assert(priv->rst);
+		udelay(2);
+		reset_control_deassert(priv->rst);
+	}
+
 	dev_set_drvdata(dev, priv);
 
 	priv->rng.name = dev_driver_string(dev),
-- 
2.15.1

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

* [PATCH Resend 1/5] hwrng: stm32 - add reset during probe
@ 2018-02-15 13:03   ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

Avoid issue when probing the RNG without
reset if bad status has been detected previously

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 63d84e6f1891..83c695938a2d 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -21,6 +21,7 @@
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/pm_runtime.h>
+#include <linux/reset.h>
 #include <linux/slab.h>
 
 #define RNG_CR 0x00
@@ -46,6 +47,7 @@ struct stm32_rng_private {
 	struct hwrng rng;
 	void __iomem *base;
 	struct clk *clk;
+	struct reset_control *rst;
 };
 
 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
@@ -140,6 +142,13 @@ static int stm32_rng_probe(struct platform_device *ofdev)
 	if (IS_ERR(priv->clk))
 		return PTR_ERR(priv->clk);
 
+	priv->rst = devm_reset_control_get(&ofdev->dev, NULL);
+	if (!IS_ERR(priv->rst)) {
+		reset_control_assert(priv->rst);
+		udelay(2);
+		reset_control_deassert(priv->rst);
+	}
+
 	dev_set_drvdata(dev, priv);
 
 	priv->rng.name = dev_driver_string(dev),
-- 
2.15.1

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

* [PATCH Resend 2/5] dt-bindings: rng: add reset node for stm32
  2018-02-15 13:03 ` Lionel Debieve
@ 2018-02-15 13:03   ` Lionel Debieve
  -1 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

Adding optional resets property for rng.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
index 47f04176f93b..cb7ca78135ff 100644
--- a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
+++ b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
@@ -11,6 +11,9 @@ Required properties:
 - interrupts : The designated IRQ line for the RNG
 - clocks : The clock needed to enable the RNG
 
+Optional properties:
+- resets : The reset to properly start RNG
+
 Example:
 
 	rng: rng@50060800 {
-- 
2.15.1

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

* [PATCH Resend 2/5] dt-bindings: rng: add reset node for stm32
@ 2018-02-15 13:03   ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

Adding optional resets property for rng.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
index 47f04176f93b..cb7ca78135ff 100644
--- a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
+++ b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
@@ -11,6 +11,9 @@ Required properties:
 - interrupts : The designated IRQ line for the RNG
 - clocks : The clock needed to enable the RNG
 
+Optional properties:
+- resets : The reset to properly start RNG
+
 Example:
 
 	rng: rng at 50060800 {
-- 
2.15.1

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

* [PATCH Resend 3/5] hwrng: stm32 - allow disable clock error detection
  2018-02-15 13:03 ` Lionel Debieve
@ 2018-02-15 13:03   ` Lionel Debieve
  -1 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

Add a new property that allow to disable the clock error
detection which is required when the clock source selected
is out of specification (which is not mandatory).

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 83c695938a2d..709a8d061be3 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -26,6 +26,7 @@
 
 #define RNG_CR 0x00
 #define RNG_CR_RNGEN BIT(2)
+#define RNG_CR_CED BIT(5)
 
 #define RNG_SR 0x04
 #define RNG_SR_SEIS BIT(6)
@@ -48,6 +49,7 @@ struct stm32_rng_private {
 	void __iomem *base;
 	struct clk *clk;
 	struct reset_control *rst;
+	bool ced;
 };
 
 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
@@ -101,7 +103,11 @@ static int stm32_rng_init(struct hwrng *rng)
 	if (err)
 		return err;
 
-	writel_relaxed(RNG_CR_RNGEN, priv->base + RNG_CR);
+	if (priv->ced)
+		writel_relaxed(RNG_CR_RNGEN, priv->base + RNG_CR);
+	else
+		writel_relaxed(RNG_CR_RNGEN | RNG_CR_CED,
+			       priv->base + RNG_CR);
 
 	/* clear error indicators */
 	writel_relaxed(0, priv->base + RNG_SR);
@@ -149,6 +155,8 @@ static int stm32_rng_probe(struct platform_device *ofdev)
 		reset_control_deassert(priv->rst);
 	}
 
+	priv->ced = of_property_read_bool(np, "clock-error-detect");
+
 	dev_set_drvdata(dev, priv);
 
 	priv->rng.name = dev_driver_string(dev),
-- 
2.15.1

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

* [PATCH Resend 3/5] hwrng: stm32 - allow disable clock error detection
@ 2018-02-15 13:03   ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

Add a new property that allow to disable the clock error
detection which is required when the clock source selected
is out of specification (which is not mandatory).

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 83c695938a2d..709a8d061be3 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -26,6 +26,7 @@
 
 #define RNG_CR 0x00
 #define RNG_CR_RNGEN BIT(2)
+#define RNG_CR_CED BIT(5)
 
 #define RNG_SR 0x04
 #define RNG_SR_SEIS BIT(6)
@@ -48,6 +49,7 @@ struct stm32_rng_private {
 	void __iomem *base;
 	struct clk *clk;
 	struct reset_control *rst;
+	bool ced;
 };
 
 static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
@@ -101,7 +103,11 @@ static int stm32_rng_init(struct hwrng *rng)
 	if (err)
 		return err;
 
-	writel_relaxed(RNG_CR_RNGEN, priv->base + RNG_CR);
+	if (priv->ced)
+		writel_relaxed(RNG_CR_RNGEN, priv->base + RNG_CR);
+	else
+		writel_relaxed(RNG_CR_RNGEN | RNG_CR_CED,
+			       priv->base + RNG_CR);
 
 	/* clear error indicators */
 	writel_relaxed(0, priv->base + RNG_SR);
@@ -149,6 +155,8 @@ static int stm32_rng_probe(struct platform_device *ofdev)
 		reset_control_deassert(priv->rst);
 	}
 
+	priv->ced = of_property_read_bool(np, "clock-error-detect");
+
 	dev_set_drvdata(dev, priv);
 
 	priv->rng.name = dev_driver_string(dev),
-- 
2.15.1

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

* [PATCH Resend 4/5] dt-bindings: rng: add clock detection error for stm32
  2018-02-15 13:03 ` Lionel Debieve
@ 2018-02-15 13:03   ` Lionel Debieve
  -1 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

Add optional property to enable the clock detection error
on rng block. It is used to allow slow clock source which
give correct entropy for rng.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
index cb7ca78135ff..1dfa7d51e006 100644
--- a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
+++ b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
@@ -13,6 +13,7 @@ Required properties:
 
 Optional properties:
 - resets : The reset to properly start RNG
+- clock-error-detect : Enable the clock detection management
 
 Example:
 
-- 
2.15.1

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

* [PATCH Resend 4/5] dt-bindings: rng: add clock detection error for stm32
@ 2018-02-15 13:03   ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

Add optional property to enable the clock detection error
on rng block. It is used to allow slow clock source which
give correct entropy for rng.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
index cb7ca78135ff..1dfa7d51e006 100644
--- a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
+++ b/Documentation/devicetree/bindings/rng/st,stm32-rng.txt
@@ -13,6 +13,7 @@ Required properties:
 
 Optional properties:
 - resets : The reset to properly start RNG
+- clock-error-detect : Enable the clock detection management
 
 Example:
 
-- 
2.15.1

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

* [PATCH Resend 5/5] hwrng: stm32 - rework read timeout calculation
  2018-02-15 13:03 ` Lionel Debieve
@ 2018-02-15 13:03   ` Lionel Debieve
  -1 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

Increase timeout delay to support longer timing linked
to rng initialization. Measurement is based on timer instead
of instructions per iteration which is not powerful on all
targets.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 709a8d061be3..0d2328da3b76 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -16,6 +16,7 @@
 #include <linux/delay.h>
 #include <linux/hw_random.h>
 #include <linux/io.h>
+#include <linux/iopoll.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
@@ -35,15 +36,6 @@
 
 #define RNG_DR 0x08
 
-/*
- * It takes 40 cycles @ 48MHz to generate each random number (e.g. <1us).
- * At the time of writing STM32 parts max out at ~200MHz meaning a timeout
- * of 500 leaves us a very comfortable margin for error. The loop to which
- * the timeout applies takes at least 4 instructions per iteration so the
- * timeout is enough to take us up to multi-GHz parts!
- */
-#define RNG_TIMEOUT 500
-
 struct stm32_rng_private {
 	struct hwrng rng;
 	void __iomem *base;
@@ -63,13 +55,16 @@ static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
 
 	while (max > sizeof(u32)) {
 		sr = readl_relaxed(priv->base + RNG_SR);
+		/* Manage timeout which is based on timer and take */
+		/* care of initial delay time when enabling rng	*/
 		if (!sr && wait) {
-			unsigned int timeout = RNG_TIMEOUT;
-
-			do {
-				cpu_relax();
-				sr = readl_relaxed(priv->base + RNG_SR);
-			} while (!sr && --timeout);
+			retval = readl_relaxed_poll_timeout_atomic(priv->base
+								   + RNG_SR,
+								   sr, sr,
+								   10, 50000);
+			if (retval)
+				dev_err((struct device *)priv->rng.priv,
+					"%s: timeout %x!\n", __func__, sr);
 		}
 
 		/* If error detected or data not ready... */
-- 
2.15.1

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

* [PATCH Resend 5/5] hwrng: stm32 - rework read timeout calculation
@ 2018-02-15 13:03   ` Lionel Debieve
  0 siblings, 0 replies; 22+ messages in thread
From: Lionel Debieve @ 2018-02-15 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

Increase timeout delay to support longer timing linked
to rng initialization. Measurement is based on timer instead
of instructions per iteration which is not powerful on all
targets.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 709a8d061be3..0d2328da3b76 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -16,6 +16,7 @@
 #include <linux/delay.h>
 #include <linux/hw_random.h>
 #include <linux/io.h>
+#include <linux/iopoll.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
@@ -35,15 +36,6 @@
 
 #define RNG_DR 0x08
 
-/*
- * It takes 40 cycles @ 48MHz to generate each random number (e.g. <1us).
- * At the time of writing STM32 parts max out at ~200MHz meaning a timeout
- * of 500 leaves us a very comfortable margin for error. The loop to which
- * the timeout applies takes@least 4 instructions per iteration so the
- * timeout is enough to take us up to multi-GHz parts!
- */
-#define RNG_TIMEOUT 500
-
 struct stm32_rng_private {
 	struct hwrng rng;
 	void __iomem *base;
@@ -63,13 +55,16 @@ static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
 
 	while (max > sizeof(u32)) {
 		sr = readl_relaxed(priv->base + RNG_SR);
+		/* Manage timeout which is based on timer and take */
+		/* care of initial delay time when enabling rng	*/
 		if (!sr && wait) {
-			unsigned int timeout = RNG_TIMEOUT;
-
-			do {
-				cpu_relax();
-				sr = readl_relaxed(priv->base + RNG_SR);
-			} while (!sr && --timeout);
+			retval = readl_relaxed_poll_timeout_atomic(priv->base
+								   + RNG_SR,
+								   sr, sr,
+								   10, 50000);
+			if (retval)
+				dev_err((struct device *)priv->rng.priv,
+					"%s: timeout %x!\n", __func__, sr);
 		}
 
 		/* If error detected or data not ready... */
-- 
2.15.1

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

* Re: [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
  2018-02-15 13:03 ` Lionel Debieve
  (?)
@ 2018-02-22 14:03   ` Herbert Xu
  -1 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-02-22 14:03 UTC (permalink / raw)
  To: Lionel Debieve
  Cc: Rob Herring, Alexandre Torgue, Arnd Bergmann, Greg Kroah-Hartman,
	linux-kernel, linux-crypto, Maxime Coquelin, Matt Mackall,
	Ludovic Barre, linux-arm-kernel, Benjamin Gaignard

On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> This set of patches add extended functionalities for stm32 rng
> driver.
> Patch #1 includes a reset during probe to avoid any error status
> which can occur during bootup process and keep safe rng integrity.
> 
> Patch #3 adds a new property to manage the clock error detection
> feature which can be disabled on specific target.
> 
> Patch #5 rework the timeout calculation for read value that was
> previously defined based on loop operation and is now based on
> timer.

I should take only patches 1/3/5, right?

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

* Re: [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-02-22 14:03   ` Herbert Xu
  0 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-02-22 14:03 UTC (permalink / raw)
  To: Lionel Debieve
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman, Maxime Coquelin,
	Alexandre Torgue, Rob Herring, linux-crypto, linux-arm-kernel,
	linux-kernel, Benjamin Gaignard, Ludovic Barre

On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> This set of patches add extended functionalities for stm32 rng
> driver.
> Patch #1 includes a reset during probe to avoid any error status
> which can occur during bootup process and keep safe rng integrity.
> 
> Patch #3 adds a new property to manage the clock error detection
> feature which can be disabled on specific target.
> 
> Patch #5 rework the timeout calculation for read value that was
> previously defined based on loop operation and is now based on
> timer.

I should take only patches 1/3/5, right?

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

* [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-02-22 14:03   ` Herbert Xu
  0 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-02-22 14:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> This set of patches add extended functionalities for stm32 rng
> driver.
> Patch #1 includes a reset during probe to avoid any error status
> which can occur during bootup process and keep safe rng integrity.
> 
> Patch #3 adds a new property to manage the clock error detection
> feature which can be disabled on specific target.
> 
> Patch #5 rework the timeout calculation for read value that was
> previously defined based on loop operation and is now based on
> timer.

I should take only patches 1/3/5, right?

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

* Re: [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
  2018-02-22 14:03   ` Herbert Xu
  (?)
@ 2018-02-22 15:25     ` Alexandre Torgue
  -1 siblings, 0 replies; 22+ messages in thread
From: Alexandre Torgue @ 2018-02-22 15:25 UTC (permalink / raw)
  To: Herbert Xu, Lionel Debieve
  Cc: Rob Herring, Benjamin Gaignard, Arnd Bergmann,
	Greg Kroah-Hartman, linux-kernel, linux-crypto, Maxime Coquelin,
	Matt Mackall, Ludovic Barre, linux-arm-kernel

Hi

On 02/22/2018 03:03 PM, Herbert Xu wrote:
> On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
>> This set of patches add extended functionalities for stm32 rng
>> driver.
>> Patch #1 includes a reset during probe to avoid any error status
>> which can occur during bootup process and keep safe rng integrity.
>>
>> Patch #3 adds a new property to manage the clock error detection
>> feature which can be disabled on specific target.
>>
>> Patch #5 rework the timeout calculation for read value that was
>> previously defined based on loop operation and is now based on
>> timer.
> 
> I should take only patches 1/3/5, right?

You could take all (dt-bindings + drivers part).

regards
alex

> 
> Cheers,
> 

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

* Re: [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-02-22 15:25     ` Alexandre Torgue
  0 siblings, 0 replies; 22+ messages in thread
From: Alexandre Torgue @ 2018-02-22 15:25 UTC (permalink / raw)
  To: Herbert Xu, Lionel Debieve
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman, Maxime Coquelin,
	Rob Herring, linux-crypto, linux-arm-kernel, linux-kernel,
	Benjamin Gaignard, Ludovic Barre

Hi

On 02/22/2018 03:03 PM, Herbert Xu wrote:
> On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
>> This set of patches add extended functionalities for stm32 rng
>> driver.
>> Patch #1 includes a reset during probe to avoid any error status
>> which can occur during bootup process and keep safe rng integrity.
>>
>> Patch #3 adds a new property to manage the clock error detection
>> feature which can be disabled on specific target.
>>
>> Patch #5 rework the timeout calculation for read value that was
>> previously defined based on loop operation and is now based on
>> timer.
> 
> I should take only patches 1/3/5, right?

You could take all (dt-bindings + drivers part).

regards
alex

> 
> Cheers,
> 

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

* [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-02-22 15:25     ` Alexandre Torgue
  0 siblings, 0 replies; 22+ messages in thread
From: Alexandre Torgue @ 2018-02-22 15:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi

On 02/22/2018 03:03 PM, Herbert Xu wrote:
> On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
>> This set of patches add extended functionalities for stm32 rng
>> driver.
>> Patch #1 includes a reset during probe to avoid any error status
>> which can occur during bootup process and keep safe rng integrity.
>>
>> Patch #3 adds a new property to manage the clock error detection
>> feature which can be disabled on specific target.
>>
>> Patch #5 rework the timeout calculation for read value that was
>> previously defined based on loop operation and is now based on
>> timer.
> 
> I should take only patches 1/3/5, right?

You could take all (dt-bindings + drivers part).

regards
alex

> 
> Cheers,
> 

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

* Re: [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
  2018-02-15 13:03 ` Lionel Debieve
@ 2018-03-02 16:33   ` Herbert Xu
  -1 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-03-02 16:33 UTC (permalink / raw)
  To: Lionel Debieve
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman, Maxime Coquelin,
	Alexandre Torgue, Rob Herring, linux-crypto, linux-arm-kernel,
	linux-kernel, Benjamin Gaignard, Ludovic Barre

On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> This set of patches add extended functionalities for stm32 rng
> driver.
> Patch #1 includes a reset during probe to avoid any error status
> which can occur during bootup process and keep safe rng integrity.
> 
> Patch #3 adds a new property to manage the clock error detection
> feature which can be disabled on specific target.
> 
> Patch #5 rework the timeout calculation for read value that was
> previously defined based on loop operation and is now based on
> timer.
> 
> Lionel Debieve (5):
>   hwrng: stm32 - add reset during probe
>   dt-bindings: rng: add reset node for stm32
>   hwrng: stm32 - allow disable clock error detection
>   dt-bindings: rng: add clock detection error for stm32
>   hwrng: stm32 - rework read timeout calculation
> 
>  .../devicetree/bindings/rng/st,stm32-rng.txt       |  4 ++
>  drivers/char/hw_random/stm32-rng.c                 | 44 ++++++++++++++--------
>  2 files changed, 32 insertions(+), 16 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] 22+ messages in thread

* [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-03-02 16:33   ` Herbert Xu
  0 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-03-02 16:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> This set of patches add extended functionalities for stm32 rng
> driver.
> Patch #1 includes a reset during probe to avoid any error status
> which can occur during bootup process and keep safe rng integrity.
> 
> Patch #3 adds a new property to manage the clock error detection
> feature which can be disabled on specific target.
> 
> Patch #5 rework the timeout calculation for read value that was
> previously defined based on loop operation and is now based on
> timer.
> 
> Lionel Debieve (5):
>   hwrng: stm32 - add reset during probe
>   dt-bindings: rng: add reset node for stm32
>   hwrng: stm32 - allow disable clock error detection
>   dt-bindings: rng: add clock detection error for stm32
>   hwrng: stm32 - rework read timeout calculation
> 
>  .../devicetree/bindings/rng/st,stm32-rng.txt       |  4 ++
>  drivers/char/hw_random/stm32-rng.c                 | 44 ++++++++++++++--------
>  2 files changed, 32 insertions(+), 16 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] 22+ messages in thread

* Re: [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
  2018-02-22 15:25     ` Alexandre Torgue
@ 2018-03-02 16:34       ` Herbert Xu
  -1 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-03-02 16:34 UTC (permalink / raw)
  To: Alexandre Torgue
  Cc: Lionel Debieve, Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Rob Herring, linux-crypto, linux-arm-kernel,
	linux-kernel, Benjamin Gaignard, Ludovic Barre

On Thu, Feb 22, 2018 at 04:25:46PM +0100, Alexandre Torgue wrote:
> Hi
> 
> On 02/22/2018 03:03 PM, Herbert Xu wrote:
> >On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> >>This set of patches add extended functionalities for stm32 rng
> >>driver.
> >>Patch #1 includes a reset during probe to avoid any error status
> >>which can occur during bootup process and keep safe rng integrity.
> >>
> >>Patch #3 adds a new property to manage the clock error detection
> >>feature which can be disabled on specific target.
> >>
> >>Patch #5 rework the timeout calculation for read value that was
> >>previously defined based on loop operation and is now based on
> >>timer.
> >
> >I should take only patches 1/3/5, right?
> 
> You could take all (dt-bindings + drivers part).

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

* [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng
@ 2018-03-02 16:34       ` Herbert Xu
  0 siblings, 0 replies; 22+ messages in thread
From: Herbert Xu @ 2018-03-02 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 22, 2018 at 04:25:46PM +0100, Alexandre Torgue wrote:
> Hi
> 
> On 02/22/2018 03:03 PM, Herbert Xu wrote:
> >On Thu, Feb 15, 2018 at 02:03:07PM +0100, Lionel Debieve wrote:
> >>This set of patches add extended functionalities for stm32 rng
> >>driver.
> >>Patch #1 includes a reset during probe to avoid any error status
> >>which can occur during bootup process and keep safe rng integrity.
> >>
> >>Patch #3 adds a new property to manage the clock error detection
> >>feature which can be disabled on specific target.
> >>
> >>Patch #5 rework the timeout calculation for read value that was
> >>previously defined based on loop operation and is now based on
> >>timer.
> >
> >I should take only patches 1/3/5, right?
> 
> You could take all (dt-bindings + drivers part).

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

end of thread, other threads:[~2018-03-02 16:34 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-15 13:03 [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng Lionel Debieve
2018-02-15 13:03 ` Lionel Debieve
2018-02-15 13:03 ` [PATCH Resend 1/5] hwrng: stm32 - add reset during probe Lionel Debieve
2018-02-15 13:03   ` Lionel Debieve
2018-02-15 13:03 ` [PATCH Resend 2/5] dt-bindings: rng: add reset node for stm32 Lionel Debieve
2018-02-15 13:03   ` Lionel Debieve
2018-02-15 13:03 ` [PATCH Resend 3/5] hwrng: stm32 - allow disable clock error detection Lionel Debieve
2018-02-15 13:03   ` Lionel Debieve
2018-02-15 13:03 ` [PATCH Resend 4/5] dt-bindings: rng: add clock detection error for stm32 Lionel Debieve
2018-02-15 13:03   ` Lionel Debieve
2018-02-15 13:03 ` [PATCH Resend 5/5] hwrng: stm32 - rework read timeout calculation Lionel Debieve
2018-02-15 13:03   ` Lionel Debieve
2018-02-22 14:03 ` [PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng Herbert Xu
2018-02-22 14:03   ` Herbert Xu
2018-02-22 14:03   ` Herbert Xu
2018-02-22 15:25   ` Alexandre Torgue
2018-02-22 15:25     ` Alexandre Torgue
2018-02-22 15:25     ` Alexandre Torgue
2018-03-02 16:34     ` Herbert Xu
2018-03-02 16:34       ` Herbert Xu
2018-03-02 16:33 ` Herbert Xu
2018-03-02 16:33   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.