linux/arch/powerpc
Michael Ellerman 11d92156f7 powerpc/pseries: Only register vio drivers if vio bus exists
The vio bus is a fake bus, which we use on pseries LPARs (guests) to
discover devices provided by the hypervisor. There's no need or sense
in creating the vio bus on bare metal systems.

Which is why commit 4336b93378 ("powerpc/pseries: Make vio and
ibmebus initcalls pseries specific") made the initialisation of the
vio bus only happen in LPARs.

However as a result of that commit we now see errors at boot on bare
metal systems:

  Driver 'hvc_console' was unable to register with bus_type 'vio' because the bus was not initialized.
  Driver 'tpm_ibmvtpm' was unable to register with bus_type 'vio' because the bus was not initialized.

This happens because those drivers are built-in, and are calling
vio_register_driver(). It in turn calls driver_register() with a
reference to vio_bus_type, but we haven't registered vio_bus_type with
the driver core.

Fix it by also guarding vio_register_driver() with a check to see if
we are on pseries.

Fixes: 4336b93378 ("powerpc/pseries: Make vio and ibmebus initcalls pseries specific")
Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Link: https://lore.kernel.org/r/20210316010938.525657-1-mpe@ellerman.id.au
2021-03-31 14:32:58 +11:00
..
boot powerpc/boot: Fix build of dts/fsl 2020-12-21 22:06:09 +11:00
configs Modules updates for v5.12 2021-02-23 10:15:33 -08:00
crypto crypto: powerpc/sha256 - remove unneeded semicolon 2021-02-10 17:55:57 +11:00
include powerpc/irq: Inline call_do_irq() and call_do_softirq() 2021-03-29 13:22:17 +11:00
kernel powerpc/irq: Inline call_do_irq() and call_do_softirq() 2021-03-29 13:22:17 +11:00
kexec powerpc/kexec_file: fix FDT size estimation for kdump kernel 2021-02-11 23:35:07 +11:00
kvm x86: 2021-02-26 10:00:12 -08:00
lib powerpc/32: Remove ksp_limit 2021-03-29 13:22:05 +11:00
math-emu powerpc/math: Fix missing __user qualifier for get_user() and other sparse warnings 2021-03-29 13:22:12 +11:00
mm powerpc/64s: Fix hash fault to use TRAP accessor 2021-03-29 13:22:15 +11:00
net bpf: Rename BPF_XADD and prepare to encode other atomics in .imm 2021-01-14 18:34:29 -08:00
perf powerpc/perf: Fix handling of privilege level checks in perf interrupt context 2021-03-02 22:41:51 +11:00
platforms powerpc/pseries: Only register vio drivers if vio bus exists 2021-03-31 14:32:58 +11:00
purgatory powerpc/kexec_file: Enable early kernel OPAL calls 2020-07-29 23:47:55 +10:00
sysdev powerpc/fsl-pci: Fix section mismatch warning 2021-03-29 13:22:14 +11:00
tools powerpc/tools: Remove 90 line limit in checkpatch script 2020-09-08 22:57:11 +10:00
xmon powerpc/32s: mfsrin()/mtsrin() become mfsr()/mtsr() 2021-02-09 01:10:15 +11:00
Kbuild
Kconfig powerpc: Fix HAVE_HARDLOCKUP_DETECTOR_ARCH build configuration 2021-03-29 13:22:19 +11:00
Kconfig.debug powerpc/xmon: Select CONSOLE_POLL for the 8xx 2021-01-31 22:35:51 +11:00
Makefile powerpc/Makefile: Remove workaround for gcc versions below 4.9 2021-03-29 13:22:11 +11:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00