]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pci: Fix pcibios_setup_device() ordering
authorShawn Anastasio <shawn@anastas.io>
Mon, 28 Oct 2019 08:54:23 +0000 (19:54 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 6 Jan 2020 05:25:28 +0000 (16:25 +1100)
commitea38e57360bcea278ae2d6d221cc0abbf56100b4
tree802ed763058ddab208230461e00070ce3772fe09
parent727fdadb3e8c4cf7b5338d8fb6103aa9fd81c34b
powerpc/pci: Fix pcibios_setup_device() ordering

Move PCI device setup from pcibios_add_device() and pcibios_fixup_bus() to
pcibios_bus_add_device(). This ensures that platform-specific DMA and IOMMU
setup occurs after the device has been registered in sysfs, which is a
requirement for IOMMU group assignment to work

This fixes IOMMU group assignment for hotplugged devices on pseries, where
the existing behavior results in IOMMU assignment before registration.

Thanks to Lukas Wunner <lukas@wunner.de> for the suggestion.

Signed-off-by: Shawn Anastasio <shawn@anastas.io>
Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191028085424.12006-2-oohall@gmail.com
arch/powerpc/kernel/pci-common.c