linux-stable/arch/powerpc
Jason A. Donenfeld 62f4859de7 powerpc/powernv: delay rng platform device creation until later in boot
commit 8875028265 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: f3eac42665 ("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:27:28 +02:00
..
boot powerpc: dts: t104xrdb: fix phy type for FMAN 4/5 2022-04-20 09:08:26 +02:00
configs vgacon: remove software scrollback support 2020-09-23 10:46:31 +02:00
crypto
include powerpc: define get_cycles macro for arch-override 2022-06-25 11:46:38 +02:00
kernel powerpc/rtas: Allow ibm,platform-dump RTAS call with null buffer address 2022-07-02 16:18:10 +02:00
kvm KVM: PPC: Book3S: Fix H_RTAS rets buffer overflow 2021-07-28 11:12:19 +02:00
lib powerpc/lib/sstep: Fix build errors with newer binutils 2022-04-20 09:08:23 +02:00
math-emu
mm powerpc: Allow 4224 bytes of stack expansion for the signal frame 2020-08-26 10:29:54 +02:00
net powerpc/bpf: Fix BPF_SUB when imm == 0x80000000 2021-11-26 11:40:36 +01:00
oprofile
perf powerpc/perf: Fix the threshold compare group constraint for power9 2022-06-14 16:53:51 +02:00
platforms powerpc/powernv: delay rng platform device creation until later in boot 2022-07-12 16:27:28 +02:00
purgatory
sysdev powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup 2022-06-14 16:53:51 +02:00
tools powerpc/tools: Don't quote $objdump in scripts 2020-01-04 13:59:39 +01:00
xmon powerpc/xmon: Change printk() to pr_cont() 2020-12-29 13:47:08 +01:00
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-05-22 10:57:32 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-22 10:57:32 +02:00
Makefile powerpc: vdso: Make vdso32 installation conditional in vdso_install 2020-01-27 14:46:30 +01:00
Makefile.postlink