]> git.baikalelectronics.ru Git - 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)
commite59d233c61bc8e95ca3cca3c69bf0babf5059cf1
treecb2bb4970c0f72011bef73235afbd37987d4937c
parent98e0ef6ce994d895f75f5e12f5289a47697290f1
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