Merge tag 'powerpc-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fix from Michael Ellerman: - On Power8 bare metal, fix creation of RNG platform devices, which are needed for the /dev/hwrng driver to probe correctly. Thanks to Jason A. Donenfeld, and Sachin Sant. * tag 'powerpc-5.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powernv: delay rng platform device creation until later in boot
This commit is contained in:
@@ -176,12 +176,8 @@ static int __init pnv_get_random_long_early(unsigned long *v)
|
||||
NULL) != pnv_get_random_long_early)
|
||||
return 0;
|
||||
|
||||
for_each_compatible_node(dn, NULL, "ibm,power-rng") {
|
||||
if (rng_create(dn))
|
||||
continue;
|
||||
/* Create devices for hwrng driver */
|
||||
of_platform_device_create(dn, NULL, NULL);
|
||||
}
|
||||
for_each_compatible_node(dn, NULL, "ibm,power-rng")
|
||||
rng_create(dn);
|
||||
|
||||
if (!ppc_md.get_random_seed)
|
||||
return 0;
|
||||
@@ -205,10 +201,18 @@ void __init pnv_rng_init(void)
|
||||
|
||||
static int __init pnv_rng_late_init(void)
|
||||
{
|
||||
struct device_node *dn;
|
||||
unsigned long v;
|
||||
|
||||
/* In case it wasn't called during init for some other reason. */
|
||||
if (ppc_md.get_random_seed == pnv_get_random_long_early)
|
||||
pnv_get_random_long_early(&v);
|
||||
|
||||
if (ppc_md.get_random_seed == powernv_get_random_long) {
|
||||
for_each_compatible_node(dn, NULL, "ibm,power-rng")
|
||||
of_platform_device_create(dn, NULL, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
machine_subsys_initcall(powernv, pnv_rng_late_init);
|
||||
|
||||
Reference in New Issue
Block a user