From: Linus Walleij <linus.walleij@linaro.org> To: Tony Lindgren <tony@atomide.com> Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>, Theodore Ts'o <tytso@mit.edu>, Paul Walmsley <paul@pwsan.com> Subject: [PATCH] ARM: omap2: throw the die id into the entropy pool Date: Wed, 4 Sep 2013 22:25:24 +0200 [thread overview] Message-ID: <1378326324-7170-1-git-send-email-linus.walleij@linaro.org> (raw) Atleast eight bytes of this number are totally unique for the device it seems, so this is a perfect candidate for feeding the entropy pool. One byte more or less of constants does not matter so feed in the entire OID struct. Cc: Theodore Ts'o <tytso@mit.edu> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- arch/arm/mach-omap2/id.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 2dc62a2..fc03cc6 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -18,6 +18,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/random.h> #include <linux/slab.h> #ifdef CONFIG_SOC_BUS @@ -130,6 +131,17 @@ void omap_get_die_id(struct omap_die_id *odi) odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); } +static int __init omap_feed_randpool(void) +{ + struct omap_die_id odi; + + /* Throw the die ID into the entropy pool at boot */ + omap_get_die_id(&odi); + add_device_randomness(&odi, sizeof(odi)); + return 0; +} +device_initcall(omap_feed_randpool); + void __init omap2xxx_check_revision(void) { int i, j; -- 1.8.1.4
WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@linaro.org (Linus Walleij) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: omap2: throw the die id into the entropy pool Date: Wed, 4 Sep 2013 22:25:24 +0200 [thread overview] Message-ID: <1378326324-7170-1-git-send-email-linus.walleij@linaro.org> (raw) Atleast eight bytes of this number are totally unique for the device it seems, so this is a perfect candidate for feeding the entropy pool. One byte more or less of constants does not matter so feed in the entire OID struct. Cc: Theodore Ts'o <tytso@mit.edu> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- arch/arm/mach-omap2/id.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 2dc62a2..fc03cc6 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c @@ -18,6 +18,7 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/random.h> #include <linux/slab.h> #ifdef CONFIG_SOC_BUS @@ -130,6 +131,17 @@ void omap_get_die_id(struct omap_die_id *odi) odi->id_3 = read_tap_reg(OMAP_TAP_DIE_ID_3); } +static int __init omap_feed_randpool(void) +{ + struct omap_die_id odi; + + /* Throw the die ID into the entropy pool at boot */ + omap_get_die_id(&odi); + add_device_randomness(&odi, sizeof(odi)); + return 0; +} +device_initcall(omap_feed_randpool); + void __init omap2xxx_check_revision(void) { int i, j; -- 1.8.1.4
next reply other threads:[~2013-09-04 20:25 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-09-04 20:25 Linus Walleij [this message] 2013-09-04 20:25 ` [PATCH] ARM: omap2: throw the die id into the entropy pool Linus Walleij 2013-09-04 22:24 ` Kevin Hilman 2013-09-04 22:24 ` Kevin Hilman
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=1378326324-7170-1-git-send-email-linus.walleij@linaro.org \ --to=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.org \ --cc=paul@pwsan.com \ --cc=tony@atomide.com \ --cc=tytso@mit.edu \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.