]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries: Only register vio drivers if vio bus exists
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 16 Mar 2021 01:09:38 +0000 (12:09 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 31 Mar 2021 03:32:58 +0000 (14:32 +1100)
commitee8c153e8e42677a8f561e070ff99342b0721da5
treec250ff5d819b2a810a88e21f8a69660d3f6017ca
parent535d36c2109ca6d020f0015951d57881c860087d
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 a86ca2a1a923 ("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: a86ca2a1a923 ("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
arch/powerpc/platforms/pseries/vio.c