Patchwork hw_random: mediatek: Setup default RNG quality

login
register
mail settings
Submitter sean.wang@mediatek.com
Date Jan. 10, 2018, 4:02 a.m.
Message ID <134f98ae3270cc6040121cf75d50c916adfe58dc.1515556571.git.sean.wang@mediatek.com>
Download mbox | patch
Permalink /patch/10153923/
State Accepted
Delegated to: Herbert Xu
Headers show

Comments

sean.wang@mediatek.com - Jan. 10, 2018, 4:02 a.m.
From: Sean Wang <sean.wang@mediatek.com>

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 <sean.wang@mediatek.com>
---
 drivers/char/hw_random/mtk-rng.c | 1 +
 1 file changed, 1 insertion(+)
Herbert Xu - Jan. 18, 2018, 12:02 p.m.
On Wed, Jan 10, 2018 at 12:02:46PM +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> 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 <sean.wang@mediatek.com>

Patch applied.  Thanks.

Patch

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)) {