Changes in 4.9.321 vt: drop old FONT ioctls random: schedule mix_interrupt_randomness() less often ata: libata: add qc->flags in ata_qc_complete_template tracepoint dm era: commit metadata in postsuspend after worker stops random: quiet urandom warning ratelimit suppression message USB: serial: option: add Telit LE910Cx 0x1250 composition bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers x86/xen: Remove undefined behavior in setup_features() MIPS: Remove repetitive increase irq_err_count igb: Make DMA faster when CPU is active on the PCIe link iio: adc: vf610: fix conversion mode sysfs node name usb: chipidea: udc: check request status before setting device address iio:accel:bma180: rearrange iio trigger get and register iio: accel: mma8452: ignore the return value of reset operation iio: trigger: sysfs: fix use-after-free on remove xtensa: xtfpga: Fix refcount leak bug in setup xtensa: Fix refcount leak bug in time.c powerpc: Enable execve syscall exit tracepoint ARM: dts: imx6qdl: correct PU regulator ramp delay ARM: exynos: Fix refcount leak in exynos_map_pmu ARM: Fix refcount leak in axxia_boot_secondary ARM: cns3xxx: Fix refcount leak in cns3xxx_init modpost: fix section mismatch check for exported init/exit sections powerpc/pseries: wire up rng during setup_arch() drm: remove drm_fb_helper_modinit xen: unexport __init-annotated xen_xlate_map_ballooned_pages() fdt: Update CRC check for rng-seed kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] swiotlb: skip swiotlb_bounce when orig_addr is zero Linux 4.9.321 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie00bdc5e2dcd549184919936708d5b0783954b1e
42 lines
924 B
C
42 lines
924 B
C
/*
|
|
* Copyright 2013, Michael Ellerman, IBM Corporation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version
|
|
* 2 of the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#define pr_fmt(fmt) "pseries-rng: " fmt
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/of.h>
|
|
#include <asm/archrandom.h>
|
|
#include <asm/machdep.h>
|
|
#include <asm/plpar_wrappers.h>
|
|
#include "pseries.h"
|
|
|
|
|
|
static int pseries_get_random_long(unsigned long *v)
|
|
{
|
|
unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
|
|
|
|
if (plpar_hcall(H_RANDOM, retbuf) == H_SUCCESS) {
|
|
*v = retbuf[0];
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
void __init pseries_rng_init(void)
|
|
{
|
|
struct device_node *dn;
|
|
|
|
dn = of_find_compatible_node(NULL, NULL, "ibm,random");
|
|
if (!dn)
|
|
return;
|
|
ppc_md.get_random_seed = pseries_get_random_long;
|
|
of_node_put(dn);
|
|
}
|