2018-01-10 04:02:57

by Sean Wang

[permalink] [raw]
Subject: [PATCH] hw_random: mediatek: Setup default RNG quality

From: Sean Wang <[email protected]>

When hw_random device's quality is non-zero, it will automatically fill
the kernel's entropy pool at boot. For the purpose, one conservative
quality value is being picked up as the default value.

Signed-off-by: Sean Wang <[email protected]>
---
drivers/char/hw_random/mtk-rng.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/char/hw_random/mtk-rng.c b/drivers/char/hw_random/mtk-rng.c
index 8da7bcf..7f99cd5 100644
--- a/drivers/char/hw_random/mtk-rng.c
+++ b/drivers/char/hw_random/mtk-rng.c
@@ -135,6 +135,7 @@ static int mtk_rng_probe(struct platform_device *pdev)
#endif
priv->rng.read = mtk_rng_read;
priv->rng.priv = (unsigned long)&pdev->dev;
+ priv->rng.quality = 900;

priv->clk = devm_clk_get(&pdev->dev, "rng");
if (IS_ERR(priv->clk)) {
--
2.7.4


2018-01-18 12:06:04

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] hw_random: mediatek: Setup default RNG quality

On Wed, Jan 10, 2018 at 12:02:46PM +0800, [email protected] wrote:
> From: Sean Wang <[email protected]>
>
> When hw_random device's quality is non-zero, it will automatically fill
> the kernel's entropy pool at boot. For the purpose, one conservative
> quality value is being picked up as the default value.
>
> Signed-off-by: Sean Wang <[email protected]>

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt