kernel_optimize_test/arch/powerpc
Jason A. Donenfeld 79af7be44c powerpc/powernv: delay rng platform device creation until later in boot
commit 887502826549caa7e4215fd9e628f48f14c0825a upstream.

The platform device for the rng must be created much later in boot.
Otherwise it tries to connect to a parent that doesn't yet exist,
resulting in this splat:

  [    0.000478] kobject: '(null)' ((____ptrval____)): is not initialized, yet kobject_get() is being called.
  [    0.002925] [c000000002a0fb30] [c00000000073b0bc] kobject_get+0x8c/0x100 (unreliable)
  [    0.003071] [c000000002a0fba0] [c00000000087e464] device_add+0xf4/0xb00
  [    0.003194] [c000000002a0fc80] [c000000000a7f6e4] of_device_add+0x64/0x80
  [    0.003321] [c000000002a0fcb0] [c000000000a800d0] of_platform_device_create_pdata+0xd0/0x1b0
  [    0.003476] [c000000002a0fd00] [c00000000201fa44] pnv_get_random_long_early+0x240/0x2e4
  [    0.003623] [c000000002a0fe20] [c000000002060c38] random_init+0xc0/0x214

This patch fixes the issue by doing the platform device creation inside
of machine_subsys_initcall.

Fixes: f3eac426657d ("powerpc/powernv: wire up rng during setup_arch")
Cc: stable@vger.kernel.org
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
[mpe: Change "of node" to "platform device" in change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220630121654.1939181-1-Jason@zx2c4.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-12 16:32:19 +02:00
..
boot powerpc: dts: t104xrdb: fix phy type for FMAN 4/5 2022-04-13 21:00:55 +02:00
configs powerpc/config: Renable MTD_PHYSMAP_OF 2021-09-18 13:40:14 +02:00
crypto
include powerpc/bpf: Fix use of user_pt_regs in uapi 2022-07-07 17:52:15 +02:00
kernel powerpc/prom_init: Fix kernel config grep 2022-07-07 17:52:15 +02:00
kexec powerpc: Set crashkernel offset to mid of RMA region 2022-04-13 21:00:56 +02:00
kvm KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator 2022-06-06 08:42:43 +02:00
lib powerpc/lib/sstep: Fix build errors with newer binutils 2022-04-08 14:40:36 +02:00
math-emu
mm powerpc/book3e: Fix PUD allocation size in map_kernel_page() 2022-07-07 17:52:15 +02:00
net powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06 2022-02-01 17:25:45 +01:00
oprofile
perf powerpc/perf: Fix the threshold compare group constraint for power9 2022-06-09 10:21:18 +02:00
platforms powerpc/powernv: delay rng platform device creation until later in boot 2022-07-12 16:32:19 +02:00
purgatory
sysdev powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup 2022-06-09 10:21:18 +02:00
tools
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-30 11:54:16 +01:00
Kbuild
Kconfig powerpc/kasan: Force thread size increase with KASAN 2022-06-14 18:32:39 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:50:34 +02:00
Makefile powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit 2022-04-08 14:40:19 +02:00
Makefile.postlink