diff options
author | Wei Yang <weiyang@linux.vnet.ibm.com> | 2015-03-25 04:23:55 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-03-30 22:02:37 -0400 |
commit | 6e628c7d33d99406cef374972c89389edcc3570f (patch) | |
tree | 21a6a79faa895cd26f5127dfaba7b3423b2ae409 /arch/powerpc/kernel | |
parent | 9e8d4a19ab66ec9e132d405357b9108a4f26efd3 (diff) |
powerpc/powernv: Reserve additional space for IOV BAR according to the number of total_pe
On PHB3, PF IOV BAR will be covered by M64 BAR to have better PE isolation.
M64 BAR is a type of hardware resource in PHB3, which could map a range of
MMIO to PE numbers on powernv platform. And this range is divided equally
by the number of total_pe with each divided range mapping to a PE number.
Also, the M64 BAR must map a MMIO range with power-of-two size.
The total_pe number is usually different from total_VFs, which can lead to
a conflict between MMIO space and the PE number.
For example, if total_VFs is 128 and total_pe is 256, the second half of
M64 BAR will be part of other PCI device, which may already belong to other
PEs.
This patch prevents the conflict by reserving additional space for the PF
IOV BAR, which is total_pe number of VF's BAR size.
[bhelgaas: make dev_printk() output more consistent, index resource[]
conventionally]
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 82031011522f..375bf7099912 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -990,6 +990,12 @@ int pcibios_add_device(struct pci_dev *dev) | |||
990 | */ | 990 | */ |
991 | if (dev->bus->is_added) | 991 | if (dev->bus->is_added) |
992 | pcibios_setup_device(dev); | 992 | pcibios_setup_device(dev); |
993 | |||
994 | #ifdef CONFIG_PCI_IOV | ||
995 | if (ppc_md.pcibios_fixup_sriov) | ||
996 | ppc_md.pcibios_fixup_sriov(dev); | ||
997 | #endif /* CONFIG_PCI_IOV */ | ||
998 | |||
993 | return 0; | 999 | return 0; |
994 | } | 1000 | } |
995 | 1001 | ||