WSL2-Linux-Kernel/arch/powerpc
Jason A. Donenfeld 8875028265 powerpc/powernv: delay rng platform device creation until later in boot
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
2022-07-04 21:11:47 +10:00
..
boot
configs
crypto
include powerpc/bpf: Fix use of user_pt_regs in uapi 2022-06-29 20:43:04 +10:00
kernel powerpc/prom_init: Fix kernel config grep 2022-06-24 13:47:26 +10:00
kexec
kvm
lib
math-emu
mm powerpc/memhotplug: Add add_pages override for PPC 2022-06-29 20:43:16 +10:00
net
perf
platforms powerpc/powernv: delay rng platform device creation until later in boot 2022-07-04 21:11:47 +10:00
purgatory
sysdev powerpc/xive/spapr: correct bitmap allocation size 2022-06-24 12:40:38 +10:00
tools
xmon
Kbuild
Kconfig powerpc/memhotplug: Add add_pages override for PPC 2022-06-29 20:43:16 +10:00
Kconfig.debug
Makefile
Makefile.postlink