arm: Add weak function definition for random pool intialization

The random pool relies on devices and other items in the system
to add entropy to the pool. Most of these devices may not be
added until later in the bootup process. This leaves a large
period of time where the random pool may not actually give
random numbers. Add a weak function for devices to override
with their own function to setup the random pool.

Change-Id: I0de63420b11f1dd363ccd0ef6ac0fa4a617a1152
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[satyap: trivial merge conflict resolution]
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Laura Abbott 2014-08-13 14:52:53 -07:00 committed by David Keitel
parent 0f97d15b0b
commit c704acd5e0
2 changed files with 7 additions and 0 deletions

View file

@ -935,6 +935,8 @@ void __init hyp_mode_check(void)
#endif
}
void __init __weak init_random_pool(void) { }
void __init setup_arch(char **cmdline_p)
{
const struct machine_desc *mdesc;
@ -1014,6 +1016,8 @@ void __init setup_arch(char **cmdline_p)
if (mdesc->init_early)
mdesc->init_early();
init_random_pool();
}

View file

@ -295,6 +295,8 @@ static inline void __init relocate_initrd(void)
u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
void __init __weak init_random_pool(void) { }
void __init setup_arch(char **cmdline_p)
{
pr_info("Boot CPU: AArch64 Processor [%08x]\n", read_cpuid_id());
@ -354,6 +356,7 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif
#endif
init_random_pool();
if (boot_args[1] || boot_args[2] || boot_args[3]) {
pr_err("WARNING: x1-x3 nonzero in violation of boot protocol:\n"
"\tx1: %016llx\n\tx2: %016llx\n\tx3: %016llx\n"