From: Greg Kroah-Hartman Date: Mon, 27 Jun 2022 11:02:32 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.4.202~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb4dbd49586556b1a8978c86420d952fb8897a8e;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: powerpc-pseries-wire-up-rng-during-setup_arch.patch --- diff --git a/queue-4.14/powerpc-pseries-wire-up-rng-during-setup_arch.patch b/queue-4.14/powerpc-pseries-wire-up-rng-during-setup_arch.patch new file mode 100644 index 00000000000..2b04bcc1b7e --- /dev/null +++ b/queue-4.14/powerpc-pseries-wire-up-rng-during-setup_arch.patch @@ -0,0 +1,81 @@ +From e561e472a3d441753bd012333b057f48fef1045b Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Sat, 11 Jun 2022 17:10:15 +0200 +Subject: powerpc/pseries: wire up rng during setup_arch() + +From: Jason A. Donenfeld + +commit e561e472a3d441753bd012333b057f48fef1045b upstream. + +The platform's RNG must be available before random_init() in order to be +useful for initial seeding, which in turn means that it needs to be +called from setup_arch(), rather than from an init call. Fortunately, +each platform already has a setup_arch function pointer, which means +it's easy to wire this up. This commit also removes some noisy log +messages that don't add much. + +Fixes: a489043f4626 ("powerpc/pseries: Implement arch_get_random_long() based on H_RANDOM") +Cc: stable@vger.kernel.org # v3.13+ +Signed-off-by: Jason A. Donenfeld +Reviewed-by: Christophe Leroy +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20220611151015.548325-4-Jason@zx2c4.com +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/platforms/pseries/pseries.h | 2 ++ + arch/powerpc/platforms/pseries/rng.c | 11 +++-------- + arch/powerpc/platforms/pseries/setup.c | 1 + + 3 files changed, 6 insertions(+), 8 deletions(-) + +--- a/arch/powerpc/platforms/pseries/pseries.h ++++ b/arch/powerpc/platforms/pseries/pseries.h +@@ -102,4 +102,6 @@ int dlpar_workqueue_init(void); + + void pseries_setup_rfi_flush(void); + ++void pseries_rng_init(void); ++ + #endif /* _PSERIES_PSERIES_H */ +--- a/arch/powerpc/platforms/pseries/rng.c ++++ b/arch/powerpc/platforms/pseries/rng.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include "pseries.h" + + + static int pseries_get_random_long(unsigned long *v) +@@ -28,19 +29,13 @@ static int pseries_get_random_long(unsig + return 0; + } + +-static __init int rng_init(void) ++void __init pseries_rng_init(void) + { + struct device_node *dn; + + dn = of_find_compatible_node(NULL, NULL, "ibm,random"); + if (!dn) +- return -ENODEV; +- +- pr_info("Registering arch random hook.\n"); +- ++ return; + ppc_md.get_random_seed = pseries_get_random_long; +- + of_node_put(dn); +- return 0; + } +-machine_subsys_initcall(pseries, rng_init); +--- a/arch/powerpc/platforms/pseries/setup.c ++++ b/arch/powerpc/platforms/pseries/setup.c +@@ -594,6 +594,7 @@ static void __init pSeries_setup_arch(vo + } + + ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare; ++ pseries_rng_init(); + } + + static int __init pSeries_init_panel(void) diff --git a/queue-4.14/series b/queue-4.14/series index 7904ea8cc51..a579be78105 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -27,3 +27,4 @@ arm-exynos-fix-refcount-leak-in-exynos_map_pmu.patch arm-fix-refcount-leak-in-axxia_boot_secondary.patch arm-cns3xxx-fix-refcount-leak-in-cns3xxx_init.patch modpost-fix-section-mismatch-check-for-exported-init-exit-sections.patch +powerpc-pseries-wire-up-rng-during-setup_arch.patch