devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@linaro.org>
To: Anton Blanchard <anton@samba.org>,
	Michael Ellerman <michael@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Rob Herring <rob.herring@calxeda.com>,
	devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] of: Feed entire flattened device tree into the random pool
Date: Sat, 27 Jul 2013 22:49:42 -0600	[thread overview]
Message-ID: <20130728044942.A58793E0A24@localhost> (raw)
In-Reply-To: <20130725143031.16af0a96@kryten>

On Thu, 25 Jul 2013 14:30:31 +1000, Anton Blanchard <anton@samba.org> wrote:
> 
> Hi Michael,
> 
> > But why not put the initcall in drivers/of/fdt.c, that way it's not
> > early but it's still common ?
> 
> Good idea! How does this look? So long as it happens before
> module_init(rand_initialize) we should be good.
> 
> Anton
> --
> 
> We feed the entire DMI table into the random pool to provide
> better random data during early boot, so do the same with the
> flattened device tree.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> 
> v2: move to drivers/of/fdt.c as suggested by Michael Ellerman
> 
> Index: b/drivers/of/fdt.c
> ===================================================================
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -17,6 +17,7 @@
>  #include <linux/string.h>
>  #include <linux/errno.h>
>  #include <linux/slab.h>
> +#include <linux/random.h>
>  
>  #include <asm/setup.h>  /* for COMMAND_LINE_SIZE */
>  #ifdef CONFIG_PPC
> @@ -714,3 +715,14 @@ void __init unflatten_device_tree(void)
>  }
>  
>  #endif /* CONFIG_OF_EARLY_FLATTREE */
> +
> +/* Feed entire flattened device tree into the random pool */
> +static int __init add_fdt_randomness(void)
> +{
> +	if (initial_boot_params)
> +		add_device_randomness(initial_boot_params,
> +				      initial_boot_params->totalsize);

be32_to_cpu(initial_boot_params->totalsize);

g.


  parent reply	other threads:[~2013-07-28  4:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25  2:51 [PATCH] powerpc: Feed entire flattened device tree into the random pool Anton Blanchard
2013-07-25  3:17 ` Michael Ellerman
2013-07-25  4:30   ` [PATCH] of: " Anton Blanchard
2013-07-25  4:42     ` David Gibson
2013-07-28  4:49     ` Grant Likely [this message]
2013-07-29  3:11       ` Anton Blanchard
2013-08-29 20:47         ` Grant Likely

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=20130728044942.A58793E0A24@localhost \
    --to=grant.likely@linaro.org \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=michael@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=rob.herring@calxeda.com \
    /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;
as well as URLs for NNTP newsgroup(s).