linux-stable/arch/powerpc/platforms/powernv
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
..
copy-paste.h
eeh-powernv.c powerpc/powernv/pci: Drop VF MPS fixup 2022-05-22 15:59:54 +10:00
idle.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
Kconfig powerpc/64s: Make hash MMU support configurable 2021-12-09 22:40:24 +11:00
Makefile powerpc/kasan: Mark more real-mode code as not to be instrumented 2022-05-29 10:30:42 +10:00
memtrace.c powerpc: rename powerpc_debugfs_root to arch_debugfs_dir 2021-08-13 22:04:26 +10:00
ocxl.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
opal-async.c powerpc: Use fallthrough pseudo-keyword 2020-07-29 21:09:37 +10:00
opal-call.c powerpc/64s: avoid reloading (H)SRR registers if they are still valid 2021-06-25 00:06:55 +10:00
opal-core.c ELF: Remove elf_core_copy_kernel_regs() 2022-04-14 14:08:26 +02:00
opal-dump.c powerpc: declare unmodified attribute_group usages const 2022-03-08 22:15:32 +11:00
opal-elog.c powerpc/opal: use default_groups in kobj_type 2022-01-05 10:59:52 +11:00
opal-fadump.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
opal-fadump.h powerpc/fadump: Fix fadump to work with a different endian capture kernel 2022-04-26 22:35:46 +10:00
opal-flash.c powerpc/powernv/flash: Check OPAL flash calls exist before using 2022-05-22 15:59:54 +10:00
opal-hmi.c powerpc/64s/powernv: Ratelimit harmless HMI error printing 2020-12-04 01:01:23 +11:00
opal-imc.c powerpc/powernv: Switch from __FUNCTION__ to __func__ 2022-05-04 19:37:44 +10:00
opal-irqchip.c powerpc: Bulk conversion to generic_handle_domain_irq() 2021-08-10 23:15:02 +10:00
opal-kmsg.c
opal-lpc.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
opal-memory-errors.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
opal-msglog.c powerpc/powernv: Add __init attribute to eligible functions 2021-12-23 22:33:15 +11:00
opal-nvram.c
opal-power.c powerpc/powernv: Add __init attribute to eligible functions 2021-12-23 22:33:15 +11:00
opal-powercap.c powerpc/powernv: Add __init attribute to eligible functions 2021-12-23 22:33:15 +11:00
opal-prd.c powerpc/powernv/prd: Unregister OPAL_MSG_PRD2 notifier during module unload 2021-10-29 16:47:32 +11:00
opal-psr.c powerpc/powernv: Make some symbols static 2019-11-13 16:58:06 +11:00
opal-rtc.c powerpc/powernv: Add __init attribute to eligible functions 2021-12-23 22:33:15 +11:00
opal-secvar.c powerpc/powernv: Add OPAL API interface to access secure variable 2019-11-13 00:33:22 +11:00
opal-sensor-groups.c powerpc/powernv: Add __init attribute to eligible functions 2021-12-23 22:33:15 +11:00
opal-sensor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
opal-sysparam.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
opal-tracepoints.c powerpc: Move C prototypes out of asm-prototypes.h 2022-03-08 22:06:25 +11:00
opal-wrappers.S
opal-xscom.c powerpc: rename powerpc_debugfs_root to arch_debugfs_dir 2021-08-13 22:04:26 +10:00
opal.c powerpc/powernv: Add __init attribute to eligible functions 2021-12-23 22:33:15 +11:00
pci-cxl.c powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
pci-ioda-tce.c KVM: PPC: Book3s: Retire H_PUT_TCE/etc real mode handlers 2022-05-19 00:44:01 +10:00
pci-ioda.c powerpc: Fix all occurences of "the the" 2022-05-22 15:59:43 +10:00
pci-sriov.c powerpc: Fix all occurences of "the the" 2022-05-22 15:59:43 +10:00
pci.c powerpc: Remove asm/prom.h from all files that don't need it 2022-05-08 22:15:04 +10:00
pci.h KVM: PPC: Book3s: Retire H_PUT_TCE/etc real mode handlers 2022-05-19 00:44:01 +10:00
powernv.h powerpc/powernv: wire up rng during setup_arch 2022-06-22 19:47:22 +10:00
rng.c powerpc/powernv: delay rng platform device creation until later in boot 2022-07-04 21:11:47 +10:00
setup.c powerpc/powernv: wire up rng during setup_arch 2022-06-22 19:47:22 +10:00
smp.c powerpc/kasan: Don't instrument non-maskable or raw interrupts 2022-05-22 15:58:29 +10:00
subcore-asm.S
subcore.c powerpc: Move update_power8_hid0() into its only user 2021-06-17 00:09:11 +10:00
subcore.h powerpc: remove unneeded semicolons 2021-02-09 00:10:50 +11:00
ultravisor.c powerpc/powernv: fix missing of_node_put in uv_init() 2022-05-22 15:58:30 +10:00
vas-debug.c powerpc/vas: Define and use common vas_window struct 2021-06-20 21:58:56 +10:00
vas-fault.c powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr 2022-05-22 15:58:27 +10:00
vas-trace.h powerpc/vas: Define and use common vas_window struct 2021-06-20 21:58:56 +10:00
vas-window.c powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr 2022-05-22 15:58:27 +10:00
vas.c powerpc/vas: Fix IRQ name allocation 2021-01-30 11:39:31 +11:00
vas.h powerpc/powernv/vas: Assign real address to rx_fifo in vas_rx_win_attr 2022-05-22 15:58:27 +10:00