]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc/powernv: don't enable SRIOV when VF BAR has non 64bit-prefetchable BAR
authorWei Yang <weiyang@linux.vnet.ibm.com>
Thu, 22 Oct 2015 01:22:14 +0000 (09:22 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 10 Feb 2016 01:04:54 +0000 (12:04 +1100)
commitb0331854190e70b9d96d39257230def45f832877
treecb2bb4970c0f72011bef73235afbd37987d4937c
parentccc9662da5494a7c4ff5ed5d167285b5a28d5fb3
powerpc/powernv: don't enable SRIOV when VF BAR has non 64bit-prefetchable BAR

On PHB3, we enable SRIOV devices by mapping IOV BAR with M64 BARs. If a
SRIOV device's IOV BAR is not 64bit-prefetchable, this is not assigned from
64bit prefetchable window, which means M64 BAR can't work on it.

The reason is PCI bridges support only 2 memory windows and the kernel code
programs bridges in the way that one window is 32bit-nonprefetchable and
the other one is 64bit-prefetchable. So if devices' IOV BAR is 64bit and
non-prefetchable, it will be mapped into 32bit space and therefore M64
cannot be used for it.

This patch makes this explicit and truncate IOV resource in this case to
save MMIO space.

Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Acked-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/pci-ioda.c