DistroKit Mailinglist
 help / color / mirror / Atom feed
From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
To: distrokit@pengutronix.de
Cc: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Subject: [DistroKit] [PATCH] platform-v7a: add patch for omap hwrng
Date: Mon, 11 Mar 2019 12:07:04 +0100	[thread overview]
Message-ID: <20190311110704.20294-1-r.czerwinski@pengutronix.de> (raw)

The kernel does not use the omap hwrng as an entropy source, since the
quality is not set. The getrandom system call is now used by OpenSSH,
which results in a long wait of 2 Minutes on first boot because of the
ed25519 key generation.
This patch sets the quality within the driver, allowing the beaglebone
black to boot fast again.

Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
---
 .../0001-hwrng-omap-Set-default-quality.patch | 35 +++++++++++++++++++
 configs/platform-v7a/patches/linux-5.0/series |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 configs/platform-v7a/patches/linux-5.0/0001-hwrng-omap-Set-default-quality.patch
 create mode 100644 configs/platform-v7a/patches/linux-5.0/series

diff --git a/configs/platform-v7a/patches/linux-5.0/0001-hwrng-omap-Set-default-quality.patch b/configs/platform-v7a/patches/linux-5.0/0001-hwrng-omap-Set-default-quality.patch
new file mode 100644
index 0000000..eb11fe8
--- /dev/null
+++ b/configs/platform-v7a/patches/linux-5.0/0001-hwrng-omap-Set-default-quality.patch
@@ -0,0 +1,35 @@
+From e99f217277bd40d0ecc6e1d506abfcd7b3a79ff7 Mon Sep 17 00:00:00 2001
+From: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+Date: Mon, 11 Mar 2019 10:19:36 +0100
+Subject: [PATCH] hwrng: omap - Set default quality
+
+Newer combinations of the glibc, kernel and openssh can result in long initial
+startup times on OMAP devices:
+
+[    6.671425] systemd-rc-once[102]: Creating ED25519 key; this may take some time ...
+[  142.652491] systemd-rc-once[102]: Creating ED25519 key; done.
+
+due to the blocking getrandom(2) system call:
+
+[  142.610335] random: crng init done
+
+Set the quality level for the omap hwrng driver allowing the kernel to use the
+hwrng as an entropy source at boot.
+
+Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
+---
+ drivers/char/hw_random/omap-rng.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
+index b65ff6962899..e9b6ac61fb7f 100644
+--- a/drivers/char/hw_random/omap-rng.c
++++ b/drivers/char/hw_random/omap-rng.c
+@@ -443,6 +443,7 @@ static int omap_rng_probe(struct platform_device *pdev)
+ 	priv->rng.read = omap_rng_do_read;
+ 	priv->rng.init = omap_rng_init;
+ 	priv->rng.cleanup = omap_rng_cleanup;
++	priv->rng.quality = 900;
+ 
+ 	priv->rng.priv = (unsigned long)priv;
+ 	platform_set_drvdata(pdev, priv);
diff --git a/configs/platform-v7a/patches/linux-5.0/series b/configs/platform-v7a/patches/linux-5.0/series
new file mode 100644
index 0000000..16f6663
--- /dev/null
+++ b/configs/platform-v7a/patches/linux-5.0/series
@@ -0,0 +1 @@
+0001-hwrng-omap-Set-default-quality.patch
-- 
2.20.1


_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de

             reply	other threads:[~2019-03-11 11:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 11:07 Rouven Czerwinski [this message]
2019-03-11 12:36 ` Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190311110704.20294-1-r.czerwinski@pengutronix.de \
    --to=r.czerwinski@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox