1
0
Fork 0
alistair23-linux/arch/powerpc/platforms
Alexey Kardashevskiy f9f8345674 powerpc/powernv/npu: Simplify DMA setup
NPU devices are emulated in firmware and mainly used for NPU NVLink
training; one NPU device is per a hardware link. Their DMA/TCE setup
must match the GPU which is connected via PCIe and NVLink so any changes
to the DMA/TCE setup on the GPU PCIe device need to be propagated to
the NVLink device as this is what device drivers expect and it doesn't
make much sense to do anything else.

This makes NPU DMA setup explicit.
pnv_npu_ioda_controller_ops::pnv_npu_dma_set_mask is moved to pci-ioda,
made static and prints warning as dma_set_mask() should never be called
on this function as in any case it will not configure GPU; so we make
this explicit.

Instead of using PNV_IODA_PE_PEER and peers[] (which the next patch will
remove), we test every PCI device if there are corresponding NVLink
devices. If there are any, we propagate bypass mode to just found NPU
devices by calling the setup helper directly (which takes @bypass) and
avoid guessing (i.e. calculating from DMA mask) whether we need bypass
or not on NPU devices. Since DMA setup happens in very rare occasion,
this will not slow down booting or VFIO start/stop much.

This renames pnv_npu_disable_bypass to pnv_npu_dma_set_32 to make it
more clear what the function really does which is programming 32bit
table address to the TVT ("disabling bypass" means writing zeroes to
the TVT).

This removes pnv_npu_dma_set_bypass() from pnv_npu_ioda_fixup() as
the DMA configuration on NPU does not matter until dma_set_mask() is
called on GPU and that will do the NPU DMA configuration.

This removes phb->dma_dev_setup initialization for NPU as
pnv_pci_ioda_dma_dev_setup is no-op for it anyway.

This stops using npe->tce_bypass_base as it never changes and values
other than zero are not supported.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:29 +10:00
..
8xx genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
40x powerpc: make of_device_ids const 2014-09-25 23:14:46 +10:00
44x powerpc/44x/Akebono: Remove select of IBM_EMAC_RGMII_WOL 2014-12-29 15:45:44 +11:00
52xx powerpc: Fix misspellings in comments. 2016-03-01 19:27:20 +11:00
82xx mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
83xx QE: Move QE from arch/powerpc to drivers/soc 2015-12-22 17:12:56 -06:00
85xx powerpc/mpc85xx: Add CPU hotplug support for E6500 2016-03-04 23:58:38 -06:00
86xx powerpc/86xx: Consolidate common platform code 2016-03-11 19:14:12 -06:00
512x mm: introduce page reference manipulation functions 2016-03-17 15:09:34 -07:00
amigaone lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
cell powerpc/mm: Replace _PAGE_USER with _PAGE_PRIVILEGED 2016-05-01 18:32:26 +10:00
chrp genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
embedded6xx powerpc32: remove ioremap_base 2016-03-11 17:18:02 -06:00
maple powerpc: Remove broken GregorianDay() 2015-12-16 12:54:04 +11:00
pasemi mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
powermac Merge branch 'topic/mprofile-kernel' into next 2016-03-11 11:20:15 +11:00
powernv powerpc/powernv/npu: Simplify DMA setup 2016-05-11 21:54:29 +10:00
ps3 powerpc/mm/hash: Add support for Power9 Hash 2016-05-01 18:32:40 +10:00
pseries powerpc/pci: Export pci_traverse_device_nodes() 2016-05-11 21:54:25 +10:00
Kconfig QE: Move QE from arch/powerpc to drivers/soc 2015-12-22 17:12:56 -06:00
Kconfig.cputype powerpc/mm/radix: Add THP support for 4K linux page size 2016-05-11 21:53:58 +10:00
Makefile powerpc: Remove platforms/wsp and associated pieces 2014-06-11 16:35:38 +10:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00